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

stopPropagation doesn't work for gesturemovestart when minTime or minDistance is set #1901

Open
mairatma opened this issue Jul 9, 2014 · 1 comment

Comments

@mairatma
Copy link
Contributor

mairatma commented Jul 9, 2014

When using minTime or minDistance, calls to stopPropagation and stopImmediatePropagation don't work for listeners of the gesturemovestart event. That's because when one of these properties are set the event is triggered asynchronously, so the listener ends up calling stopPropagation after the browser has already propagated the original events. Since DOMEventFacade relies on the browser to stop the propagation, gesturemovestart triggers for other nodes regardless of requests not to do so.

The best way I could find to fix this bug right now was to simulate the browser work for stopping events. I'm doing this by storing information about the request to stop the propagation in the native event, and using that to find out which events should be ignored.

I'll be sending a pull request with this soon, but let me know if anyone can find a better solution for it.

@mairatma
Copy link
Contributor Author

mairatma commented Jul 9, 2014

/cc @eduardolundgren

mairatma added a commit to mairatma/yui3 that referenced this issue Jul 9, 2014
…minTime or minDistance is set

When using minTime or minDistance, stopPropagation calls don't work anymore for the gesturemovestart event. That's because these are triggered asynchronously, so stopPropagation ends up being called after the original events already propagated. This is explained in more detail in issue yui#1901.
This is fixing the problem by adding a flag to the original event indicating it has been stopped, and then preventing any gesturemovestart events tied events with that flag from firing.
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