Skip to content

Commit

Permalink
fix: fixup regression for mouseenter/mouseleave events introduced by t…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
alpadev committed Apr 18, 2021
1 parent 88ae2ac commit 4dd335f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/src/dom/event-handler.js
Expand Up @@ -170,7 +170,7 @@ function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
if (customEventsRegex.test(originalTypeEvent)) {
const wrapFn = fn => {
return function (event) {
if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && event.relatedTarget.contains(event.delegateTarget))) {
if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) {
return fn.call(this, event)
}
}
Expand Down

0 comments on commit 4dd335f

Please sign in to comment.