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

fix: rely on screenY in stead of clientY for determining drag distance #154

Conversation

andrejilderda
Copy link
Contributor

The issue in #151 is caused by the event.clientY which is negative the second time the drawer opens on Safari after scrolling (for whatever reason...). Changing this value to event.screenY fixes the issue as can be seen in the before/after video attached below (sorry, it's hard to read due to the 10mb upload limit 😅).

If you want to test this yourself, see this branch.

Untitled.mov

Note: 5 E2E tests fail, but this is also the case for develop.

@vercel
Copy link

vercel bot commented Oct 25, 2023

@andrejilderda is attempting to deploy a commit to the emil Team on Vercel.

A member of the Team first needs to authorize it.

@devopsbarista
Copy link

devopsbarista commented Nov 6, 2023

The issue in #151 is caused by the event.clientY which is negative the second time the drawer opens on Safari after scrolling (for whatever reason...).

@andrejilderda Dealbreaker for me as well, currently solving it (not ideal) with height: 100vh and overflow: auto on the body. The reason is shrinking/expanding of the Safari tab bar. When you scroll down, it shrinks and then when you open the drawer it expands causing the behavior you're seeing on subsequent opening. If you scrolled again before opening it for the second time, it would have been fine. It also messes up the scroll (if you have one) inside of the drawer. Vercel has the same issue with the table of contents here for example: https://nextjs.org/learn/dashboard-app/getting-started.

@emilkowalski Any chance this could be merged?

@emilkowalski emilkowalski merged commit 436d0a3 into emilkowalski:main Nov 6, 2023
@emilkowalski
Copy link
Owner

Merged, thanks!

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.

3 participants