-
Notifications
You must be signed in to change notification settings - Fork 17
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
Scrollable content cannot dismiss #36
Comments
+1 |
1 similar comment
+1 |
Upstream issue emilkowalski/vaul#281 |
@zernonia hi, maybe this is solution emilkowalski/vaul#281 (comment) it is not the best one, but at least prevent strange things |
From a short check those lines from the upstream code: https://github.com/emilkowalski/vaul/blob/main/src/index.tsx#L577-L600 seem to be missing: https://github.com/radix-vue/vaul-vue/blob/main/packages/vaul-vue/src/controls.ts#L544-L560 which might be related to the scrolling issues I've notice when comparing |
Is this actually an upstream issue? Vaul's docs has an example on scrollable content and it seems to be fine, I just can't seem to make the same happen with this Vue port (Android 14; Chrome 130) Not sure if their docs has an up-to-date version of the library or not. |
Hi any news with this bug ? Personally, the solution of using data-vaul-no-drag also causes unwanted behavior during the first drags. |
Has anyone come up with a solution? The problem occurs only when we have "overflow-*" to the DrawerContent or its children, and happens only on touch devices. In original Shadcn UI website, they use Drawer for the menu with scrollable content, and that works fine. |
Is this issue addressed in the latest release? |
+1 |
1 similar comment
+1 |
Guys instead of spamming useless +1 you should upvote the issue, or may open a PR, but this adds nothing except for spam. Anyway, this issue makes vaul-vue kinda useless. My drawer comes from the side and has scrollable content. With scrollable content either the content cant be scrolled if |
Hey @harkor @zernonia thanks for the PR! However, doesnt this just set the default of
|
Am I misunderstanding what the original issue was about? because here's a StackBlitz example using the latest version where I can still reproduce it. I've tested with Chrome 134 on Android 15. |
I don't think this issue is fixed. https://ui.shadcn.com/ Just open the original shadcn website and shadcn-vue website in mobile version. Open the menu. Both of them use Drawer to display menu in mobile version. But the shadcn-vue version has 2 problems:
The original shadcn menu drawer doesn't have those 2 issues. (I found a hacky trick to fix the problem 1 by adding scroll listener to the DrawerContent that check if the drawer content position is at the top or not, if at the top, then apply class "touch-pan-down" so it can only swiped up, but swiped bottom will not scroll the content, rather close the drawer.) |
Can this be reopened please? @zernonia |
Workaround that I do for now using VueUse: const isOpen = ref(false);
const contentRef = ref(null);
const { isSwiping, direction } = useSwipe(contentRef);
watch(isSwiping, () => {
if (direction.value === 'right') {
isOpen.value = false;
}
}); So there is no nice "dragging effect", but at least it is functunal. |
The drawer with scrollable content cannot be dismissed. pls see the code below
The text was updated successfully, but these errors were encountered: