-
Notifications
You must be signed in to change notification settings - Fork 95
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
jquery__pointernative: pointerenter / pointerleave events bubble up to the document root #802
Conversation
Note, the only browsers I've tested it are Chrome and Fx. |
Could you add spec for |
@dfilatov we already had simple tests for 🆙 |
BTW: It seems that no one of currently popular Pointer Events Polyfils (MS, Polymer or jquery's PEP) would pass this test case, as they use native |
var target = event.target, | ||
relatedTarget = event.relatedTarget; | ||
|
||
while(target && !this.contains(target, relatedTarget)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it expensive? contains
has inner cycle as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, yep, haven't thought about it :(
What if I rewrite it like this:
if(!this.contains(target, relatedTarget)) {
do {
event.target = target;
fn.call(this, event); // we need to emit non bubbling events here on the subtree from target to relatedTarget
} while(target = target.parentNode && target !== relatedTarget)
}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho looks better
to the document root fix #801
🆙 |
this.enterLeave(event, this.enter); | ||
}, | ||
|
||
enterLeave : function(event, fn) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the name of the method, but I couldn't decide how to call it :(
👍 |
@narqo Don't forget do the same PR to v3 |
jquery__pointernative: pointerenter / pointerleave events bubble up to the document root
fix #801
/cc @dfilatov