-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Drawer close on drag when direction is set to right and scrollable content #243
Comments
I found this bug, thanks @imopbuilder for reporting it Additional notes to leave to maintainer to get better ideas for solution: More than likely the scroll area overrides the swipe functionality, so instead of being able to swipe, you can only scroll. this problem has been solved by MUI library, more specifically this https://mui.com/material-ui/react-drawer/#swipeable component, the MUI has proven it's possible to do it, so it's up to Edit: @imopbuilder mentioned that this bug appears when direction is set to |
@MilanObrenovic This is unrelated. The issue here is that initially, when the only position was bottom, you were only able to drag once you scrolled all the way to the top, like an iOS Sheet. That being said now that we can use it on the sides I'll disable that functionality for right and left positioned drawers. |
what do you mean with disable? is this gonna be fixed or not? I just want to use the drawer as a side nav on mobile and swipe to close it even after scrolling. Thats it |
This has been fixed 👍🏻 |
Perfect. I just tested and can confirm that it works. Great job, thank you |
While further testing, i think this created a side effect. Once the drawer from left is open, if you |
This could have not been caused by that PR, as this doesn’t touch the code related to that logic. Can you provide a codesandbox with reproduction? |
nevermind, this has existed before. i just tested on https://ui.shadcn.com/docs/components/drawer official docs. you can try it yourself there. is this behavior intentional to close the drawer onClickDown, instead of onClickUp? |
Yes, Radix does that as well. |
When the
Drawer
direction is set toright
and having a scrollable content, the drawer is only closing when the scrollbar is on top but not closing on drag when there is a scrollSandbox: https://codesandbox.io/p/devbox/drawer-direction-right-forked-qvsts5?workspaceId=021ca430-6b5a-4f63-b53b-b37cac3c53d8
vaul-issue.mp4
The text was updated successfully, but these errors were encountered: