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

Stop event propagation #15

Open
rreusser opened this issue Sep 20, 2016 · 0 comments
Open

Stop event propagation #15

rreusser opened this issue Sep 20, 2016 · 0 comments

Comments

@rreusser
Copy link
Contributor

rreusser commented Sep 20, 2016

I end up typing this in nearly every example, otherwise the events leak through and, for example, pan the underlying view even when I'm dragging a slider:

var el = document.querySelector('.control-panel');
var events = ['mousemove', 'click', 'mousedown', 'mouseup'];
for (var i = 0; i < events.length; i++) {
  el.addEventListener(events[i], function(ev) {
    ev.stopPropagation();
  });
}

Note to self: make a PR for this! I wonder what the full set of events stopped from propagating should be.

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