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

wheel step prop doesnt work #495

Open
MartinArauz opened this issue Jul 7, 2024 · 1 comment
Open

wheel step prop doesnt work #495

MartinArauz opened this issue Jul 7, 2024 · 1 comment

Comments

@MartinArauz
Copy link

Describe the bug
I have an svg with many paths. I'm testing the step property of weel, but it doesn't alter the zoom sensitivity in any way:

<TransformWrapper
initialScale={6.0}
initialPositionX={initialPosition.x}
initialPositionY={initialPosition.y}
minScale={1}
disabled={false}
limitToBounds={true}
onZoom={(value) => handleZoom(value)}
wheel={{step: 0.5}}

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Chrome
  • Version 126.0.6478.127
@rohmunen
Copy link

rohmunen commented Aug 2, 2024

I've recently ran into this. I think it's because smooth prop is set to true by default. So to achieve what you want you can try altering smoothStep instead of step: wheel={{ smoothStep: 0.5 }}. Another way is to change smooth prop on TransformWrapper to false and keep wheel={{step: 0.5}} prop.

reference: https://bettertyped.github.io/react-zoom-pan-pinch/?path=/docs/docs-props--page

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