Weird onMouseEnter behavior

Here's an abstraction of the React I have:
h4.name
{isNameHovered && div.message}
h4.name
{isNameHovered && div.message}
The h4 has an onMouseEnter and onMouseLeave event that sets the isNameHovered state which is responsible for rendering the message. It does what it's supposed to do but for some reason the message opacity changes relative to position within the h4. https://gyazo.com/bd8fad7560ee8d78f74edbdde4d80f59 This only happens if I try to enter the h4 from the bottom; the top is fine. I have no animation styles set on anything relating to this.
5 Replies
tejveer
tejveerOP5mo ago
Hm, gyazo doesn't seem to be capturing the opacity changes But either way, it's flickering too much as well
tejveer
tejveerOP5mo ago
It's perfectly fine when from top
Chris Bolson
Chris Bolson5mo ago
That sort of flickering normally happens when a different element is covering part of the element with the hover. In this case it is probably the message element itself. However, without seeing some code ,it is very hard to tell.
tejveer
tejveerOP5mo ago
I think that might just be it. I haven't properly positioned the message. I'll try changing its position and get back to you. Thanks, you were right. I set z-index to check and it doesn't flicker as much now
Want results from more Discord servers?
Add your server