Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression for handling mouseenter/mouseleave events introduced by #33310 #33679

Merged
merged 4 commits into from
Apr 19, 2021

Conversation

alpadev
Copy link
Contributor

@alpadev alpadev commented Apr 18, 2021

Sorry had a little logic error with this.

The old logic was based on relatedTarget to contain the delegatedTarget.

This is correct while moving from the parent onto a child element (mouseover) with the relatedTarget being the parent element that contains the delegatedTarget (child). And also while moving from the child onto the parent (mouseout) with the relatedTarget being the parent element that contains the delegatedTarget (child).

So for parent-child relationships this was working totally fine.

The problem comes when moving onto sibling or unconnected elements. The updated logic should handle this properly now, as it checks for the delegatedTarget not to contain the relatedTarget. Which is the case for parent (related) -- mouseover --> child (delegated) and parent (related) <-- mouseout -- child (delegated) movements. And also with sibling/unconnected (related) -- mouseover --> listener (delegated) and sibling/unconnected (related) <-- mouseout -- listener (delegated).

Sorry again.. 😓

there is a regression introduced by twbs#33310 - this would have catched that
…wbs#33310

the old logic only worked for parent-child movement since it checked for the relatedTarget to contain the delegateTarget - this should be fixed with this
@alpadev alpadev added js confirmed v5 p1 Critical, and inhibits core functionality labels Apr 18, 2021
@alpadev alpadev requested a review from a team as a code owner April 18, 2021 21:24
@XhmikosR XhmikosR changed the title Fix the regression for handling mouseenter/mouseleave events introduced by #33310 Fix regression for handling mouseenter/mouseleave events introduced by #33310 Apr 19, 2021
@XhmikosR XhmikosR added the skip-changelog So that the release drafter action doesn't include it label Apr 19, 2021
@XhmikosR XhmikosR merged commit d67121d into twbs:main Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed js p1 Critical, and inhibits core functionality skip-changelog So that the release drafter action doesn't include it v5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants