On the times that I have taken melatonin, it gave me bad dreams. If it had that effect on your daughter she would likely tell you, but you might quiz her about it a little.
Melatonin actually reduces my dreams.
I historically had very vivid and intense dreams. The other substance I used to dampen down my dreams is not legal in my state.
The thing I notice in my child is that melatonin is merely a request to settle down, not an order, so she will still be crazy an hour after taking it, so if I take it (it knocks me out) I must give her a big head start over me.
The product we use is melatonin gummies from Target. There are several other ingredients besides melatonin to aid sleep. I give my kid half of the adult dose, and let her dry out on Fridays/Saturdays.
I also take half a dose and notice
A) it wears off part way through the night, and
B) my body develops a tolerance very quickly.