Skip to content

disable mouse scroll #436

@mac2000

Description

@mac2000

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions