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

disable mouse scroll #436

Open
mac2000 opened this issue Jan 1, 2025 · 0 comments · May be fixed by #437
Open

disable mouse scroll #436

mac2000 opened this issue Jan 1, 2025 · 0 comments · May be fixed by #437

Comments

@mac2000
Copy link
Contributor

mac2000 commented Jan 1, 2025

Hello

for a use cases when Voyager is used as additional widget not taking whole screen it may be useful to disable scroll handler

imagine UI where you have more than one Voyager and / or Voayger somewhere in the middle of the page, because it does catch mouse scroll it breaks page behavior

here is an example of what I mean (as soon as I try to scroll page and my mouse lands on Voyager everything behaves strange)

scroll.mp4

from what I see in code, there is no such an option, but it is available in underlying pan to zoom library, so probably it may be added as optional, backward compatible parameter, e.g.:

image

note: by intent name is disableMouseWheelZoom so it is backward compatible, opt-in setting, from one side you may complain why not pass all pan to zoom properties, but what if it will be changed tomorrow, probably it should not be exposed, and with this approach, new params may be exposed as needed in future

and here is how implementation part may look like

image

note: here, Viewport is internal, so we are free to "expose" all options, so we can pass them as needed from other places, alternatively we may continue add constructor parameters, but I am afraid it can become messy very quickly

and finally here we are wiring up everything togther

image

note: once again, setting is opt-in and backward compatible, so should not brake anything

Hopefully it may be interesting of maintainers, so just in case will create small accompanying pull request just to not loose changes

@mac2000 mac2000 linked a pull request Jan 1, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant