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

Confusing behavior onTouch / onBeforeWheel. #40

Open
sebakerckhof opened this issue Aug 30, 2018 · 1 comment
Open

Confusing behavior onTouch / onBeforeWheel. #40

sebakerckhof opened this issue Aug 30, 2018 · 1 comment

Comments

@sebakerckhof
Copy link

sebakerckhof commented Aug 30, 2018

Currently there are 2 functions that are called before user interaction is handled:
-onTouch
-beforeWheel

But I find the API of these confusing, since onTouch is only meant to return 'false' if you want to propagate the touches, while onBeforeWheel is only meant to return 'true' if you don't want the library to handle the event.

I'd propose to unify these and extend them to each of these listeners:
-beforeTouch
-beforeWheel
-beforeMouseDown
-beforeDoubleClick
-beforeKeyDown

Each of these could then return: { ignore: boolean, propagate: boolean }.
This would also make it easier to for example allow drag/drop within the panzoom region.

I could make a PR for this, but since it'd mean a breaking change I'd rather get your thoughts on this first.

@anvaka
Copy link
Owner

anvaka commented Oct 19, 2018

Oh, I love this idea!

I agree with you: current implementation is confusing.

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

2 participants