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: Prevent sheet from exceeding boundaries of the last snap point while dragging #206

Merged
merged 1 commit into from
Jan 20, 2024

Conversation

erisleci
Copy link
Contributor

There's currently a bug I noticed that lets the drawer exceed the snap points boundaries. You can reproduce this by dragging down and as soon as the animation starts, switch to dragging up (without releasing). Is there any use case where this might be needed? If so maybe we can introduce a prop. Let me know

Sandbox: https://codesandbox.io/p/devbox/drawer-snap-points-forked-3xxclj?file=%2Fapp%2Fmy-drawer.tsx
Video: https://www.loom.com/share/db36353318114dedb964d320be8849fc?sid=05234bb7-f938-4666-aba4-b57bd1e993ae

Copy link

vercel bot commented Jan 14, 2024

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

A member of the Team first needs to authorize it.

@emilkowalski
Copy link
Owner

So to clarify - if you release the drag it will go back to the latest snap point?

@erisleci
Copy link
Contributor Author

So to clarify - if you release the drag it will go back to the latest snap point?

yeah, onRelease is fine, even if we exceed the boundaries of the last snap point (while dragging) as soon as we release it gets back to closest snap point. onDrag on the other hand can get out of boundaries (upwards)

@emilkowalski emilkowalski merged commit 90b0e56 into emilkowalski:main Jan 20, 2024
1 of 2 checks passed
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.

None yet

2 participants