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

support for event.movementX/Y [feature-request] #6723

Closed
caub opened this issue May 7, 2016 · 10 comments
Closed

support for event.movementX/Y [feature-request] #6723

caub opened this issue May 7, 2016 · 10 comments

Comments

@caub
Copy link

caub commented May 7, 2016

currently it seems synthetic events don't have those properties on mousemove

@caub
Copy link
Author

caub commented May 7, 2016

oh .nativeEvent sorry

@caub caub closed this as completed May 7, 2016
@jimfb
Copy link
Contributor

jimfb commented May 8, 2016

@zpao @syranide @spicyj Is this something we want to support? Looks like the status is "Candidate Recommendation" but it is supported by a couple browsers.

@sophiebits
Copy link
Collaborator

Sounds like Firefox, Chrome, and Edge all support it. We might as well too though I don't know if it's worth polyfilling.

@aweary
Copy link
Contributor

aweary commented May 8, 2016

@jimfb @spicyj so do you guys want to add it only in supported browsers, or polyfill it as well?

@gaearon
Copy link
Collaborator

gaearon commented May 8, 2016

If we add something to the synthetic event object, it needs to be available in all browsers.

@aweary
Copy link
Contributor

aweary commented May 8, 2016

Does the synthetic event system have a way to access the previous instance of an event? Since movementX is the difference between the current screenX and last screenX value. Or should that possibly be tracked in something like MouseMetrics?

@syranide
Copy link
Contributor

syranide commented May 8, 2016

I'm always a bit weary when polyfilling things that require rather non-trivial logic as opposed to just interpolating some data. Case in point; to do this I can only assume we would be required to have a permanent global mouse move listener which tracks the last X/Y value, this feels bad (EDIT: There was a lot of fuss to get rid of the ViewportMetrics listener). There's potential for issues here, an event being stopped, event order (or is it just for mousemove?), unnecessary global mouse move listener, etc.

@aweary
Copy link
Contributor

aweary commented May 8, 2016

It should be just for mousemove. If it just calculates the difference between the last two mousemove events it doesn't seem too complicated to keep track of but I'm sure I might not be considering some corner cases/gotchas with my PR.

@jasonwilliams
Copy link
Contributor

jasonwilliams commented Feb 16, 2017

I've added a new PR for this
#9018

@nhunzaker
Copy link
Contributor

Closed, with #9018. Thanks again, @jasonwilliams!

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

No branches or pull requests

8 participants