They CAN regulate such a transaction IF such transaction would affect interstate commerce. This is sort of covered by (Assuming I understand it correctly as a layman) the basis for the some of the precedent in Heart of Atlanta Motel v. U.S. (379 U.S. 241, 1964)
There is probably a case that's better on point... But for now, this example will work- Because the Heart of Atlanta Motel was just off the Interstate, and likely
to do business with non-state residents based on both location and type of business, the Civil Rights Act of 1964 applied to the motel.
Or something like that.