The observation that "as stock prices rise people tend to buy more of it, so here the "law of demand" holds in reverse", is one of the more widespread misconceptions related to economic thinking.
To expand on @StevenLandsburg comment, the "demand curve" (or "schedule") describes a static relation between the quantity of a good and its price. Its quality (in the general sense of features, qualities) remains constant, as we trace the demand curve.
In our case we think of the stock as the good, and we have also its price. Now what happens when the price goes up? Are we talking about the same good? Definitely no. The price raise itself signals that we now have a better good (higher discounted future profits). But then we have a different good.
So the pairs $(p_1, q_1)$ and $(p_2, q_2)$ do not really belong to the same demand schedule. So the "law of demand" is irrelevant here as a tool to describe the situation (we could picture it as a shift of the whole demand schedule outwards)
If one wants to try to think "intuitively" about the law of demand and stocks, then one can consider the following thought experiment:
Assume that you can buy the same stock on the same day at two different prices (it can happen, the world is not really one single market, even for stocks -and transactions can happen also outside of the stock market).
Assume that you cannot choose the seller, which will be determined randomly. But you have to commit beforehand about the number of pieces that you will buy. And you know the two prices.
What are you going to do?
Commit to buy more pieces if you are dealt the expensive seller, and fewer pieces if you are dealt the cheaper seller? Sounds ridiculously obvious, isn't it?