Skip to content

Nested Components Triggering Floating Elements Unexpectedly #2510

Closed Answered by totorofly
totorofly asked this question in React
Discussion options

You must be logged in to vote

Unlike mouseover, the mouseenter event does not bubble. This means that if the event occurs on a child element, the mouseenter event handler on the parent element will not be triggered. On the other hand, the mouseover event will bubble from the innermost child element to the outermost parent element. To achieve the effect I want, I switched from using mouseover to mouseenter. Additionally, I have another nested child element inside the element I'm interested in. I set its pointer-events to none so that the mouseenter event would 'pass through' to the layer of the element that I want to detect. This way, I can achieve the desired effect.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@totorofly
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by totorofly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
React
2 participants
Converted from issue

This discussion was converted from issue #2506 on August 26, 2023 08:09.