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

feat(toggle-pan): Add toggle to switch between "Scroll to Pan" and "Scroll to Zoom" #2017

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

infinia-yzl
Copy link

@infinia-yzl infinia-yzl commented Aug 14, 2024

Motivation:

To improve UX with trackpads.

Explanation:

The current trackpad behaviour does not feel natural. Usually when scrolling on a trackpad using 2 fingers, the page or content would Pan; whereas Zooming is achieved by pinching 2 fingers.

Considerations:

On a mouse, it is arguably more user-friendly to Scroll to Zoom. Therefore, I have added a toggle button to switch between behaviours.

I opted for the default behaviour to be Scroll to Pan because there are already various methods to control the zoom levels, and I believe that panning actions are more common than zooming. For context, the default Double-click behaviour is set to Zoom In; and there are the Zoom In & Out buttons on the toolbar to control the zoom levels. Open to discussion / change.

Changes:

Screenshot:

New button
image

…ll to zoom

- Modify wheel behaviour to pan by default for a more natural behaviour with trackpads (BetterTyped/react-zoom-pan-pinch#447)
- Bump `react-zoom-pan-pinch` version to `3.6.1` from `3.4.4`
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 this pull request may close these issues.

1 participant