Nope, each buyer has its own motivations. People usually sell when the price increase to their liking in the casino. Shares are traded all the time, not just on the days of dividend payments day. Tesla so far never paid dividends anyway. Maybe there are people who bought shares and don't trade them and wait for a payout, but if you look at the volumes traded you can easily see that they are a very small minority.
You sell when you think the company is overvalued, you buy when you think it is undervalued. Some might treat it as a casino but those are not the big players, as treating it as a casino will most likely lose money and not be profitable.
Paying dividends is just moving money from the company's bank account to the share owners, it doesn't have anything to do with the value of the rest of the company.