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

cross-browser compatibility for use mouse event "target" #14

Open
therewasaguy opened this issue Sep 2, 2015 · 0 comments
Open

cross-browser compatibility for use mouse event "target" #14

therewasaguy opened this issue Sep 2, 2015 · 0 comments

Comments

@therewasaguy
Copy link
Member

Mouse events are using e.toElement and e.srcElement, but we're getting e.toElement is undefined in Firefox, where mouse event properties like toElement, fromElement, and srcElement aren't implemented.

I think we can use e.target for all of these. And there might be places where e.currentTarget, and e.relatedTarget will come in handy. These three are compatible across browsers.

More info:
http://stackoverflow.com/questions/31865416/what-is-the-difference-between-event-target-event-toelement-and-event-srcelemen

https://developer.mozilla.org/en-US/docs/Web/API/Event/Comparison_of_Event_Targets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant