-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BUGFIX beta] fix mouseEnter/Leave event delegation w/o jQuery for SVG & IE11 #17227
Conversation
Had one failure under the
|
Hm, ok, I'll check this. Although I did not touch the jQuery-based implementation, so the added test seems to have uncovered this!? |
@simonihmig - Yeah, looks like it... |
(!related || (related !== target && !target.contains(related))) | ||
(!related || | ||
(related !== target && | ||
!(target.contains ? target.contains(related) : contains(target, related)))) |
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'd vaguely prefer to always use contains(target, related)
and tweak the contains util to deal with the ternary, what do you think?
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.
Makes sense!
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.
Done!
@@ -335,7 +336,9 @@ export default EmberObject.extend({ | |||
while ( | |||
target && | |||
target.nodeType === 1 && | |||
(!related || (related !== target && !target.contains(related))) | |||
(!related || |
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 know this isn't new, but I'm curious why are we checking !related
here? Can we tweak this to avoid boolean coercion? What do we expect target.relatedTarget
to be? I was thinking it could only be either undefined
or null
, if thats correct we could (possibly in a different PR?) tweak to related === undefined && related === null
...
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.
According to the specs the uninitialized value must be null
, so I changed this to a strict null check.
5676c4b
to
82ee67f
Compare
Not sure why this is happening, but the root cause seems to be with jQuery. With How should we deal with that? Skip the test when using this older version of jquery? Or can we update the test suite's old jQuery version, like using the latest 1.x? |
Lets change our oldest tested jQuery to 1.10.0. Mind updating for that? |
Updates the suite of tests for old jQuery versions to run with latest of 1.10.x, 1.12.x and 2.2.x. Unlocks emberjs#17227 which is failing due to jQuery 1.8 presumably not handling events on SVGs correctly.
Perfect, #17268 is landed. Ready for rebase / linting fix now. |
…G elements in IE11 IE11 does not support `Node#contains()` on SVG elements, so in that case a custom fallback implementation is used Fixes emberjs#17225
82ee67f
to
62d6096
Compare
@rwjblue done, green! :) |
Thank you very much @simonihmig! |
IE11 does not support
Node#contains()
on SVG elements, so in that case a custom fallback implementation is used.Fixes #17225