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

Question: Why is it scrolling with an "offset"? #47

Open
bytasv opened this issue Mar 27, 2023 · 2 comments
Open

Question: Why is it scrolling with an "offset"? #47

bytasv opened this issue Mar 27, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@bytasv
Copy link
Sponsor

bytasv commented Mar 27, 2023

Hey @daybrush - I know this isn't much, but maybe you have some ideas why this could be happening 👇

CleanShot.2023-03-27.at.23.38.21.mp4

When I scroll it doesn't "stick" to the point where the cursor is and starts slowly moving away.
This is my config:

	<InfiniteViewer
        ref={viewerRef}
        useWheelScroll
        wheelPinchKey='meta'
        useAutoZoom
        zoomRange={[CANVAS_VIEWER_MIN_SCALE, CANVAS_VIEWER_MAX_SCALE]}
        wheelScale={0.005}
        threshold={100}
        onPinch={(event) => {
          const { zoom: newZoom } = event

          viewerRef.current?.setZoom(newZoom)
        }}
      >
        {children}
      </InfiniteViewer>

I can see it's working in your demo, so it must be something on my end. I know it's tough without actual reproduction, but MAYBE you already see what might be causing that.

Thank you

@daybrush daybrush added the bug Something isn't working label Mar 30, 2023
@daybrush
Copy link
Owner

@bytasv

Um... I don't know.

But let's take a few guesses

If the container and viewport sizes are different from the stored values, the following problems may occur.

Try useResizeObserver. The size will automatically update.

@bytasv
Copy link
Sponsor Author

bytasv commented Mar 30, 2023

Thanks for guess! But useResizeObserver didn't help :( I know it's impossible to debug, but maybe someone will bump into similar issue and find a solution, or maybe I will eventually find out why its happening and can share that 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants