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

Scroll does not work if drawer disappeares before close #51

Closed
AlexXanderGrib opened this issue May 31, 2024 · 0 comments · Fixed by #55
Closed

Scroll does not work if drawer disappeares before close #51

AlexXanderGrib opened this issue May 31, 2024 · 0 comments · Fixed by #55
Assignees

Comments

@AlexXanderGrib
Copy link

How to reproduce

  1. Open https://www.shadcn-vue.com/docs/components/drawer.html
  2. Scroll to Responsive Dialog
  3. Open devtools, resize window to width 500px
  4. Click "Edit profile"
  5. Resize window to width 800px
  6. Close dialog
  7. Scroll is gone

Reason

Responsive Dialog is a component that implemented like this

<Dialog v-if="isDesktop" v-model:open="isOpen"> ... </Dialog>
<Drawer v-else v-model:open="isOpen">... </Drawer>

And drawer keeps this styles on body, since when viewport changes it does not close

<body style="right: 0px; position: fixed; top: 0px; left: 0px; height: auto; pointer-events: none; overflow: hidden;">

Possible solution

  • add onUnmounted() that removes this style
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 a pull request may close this issue.

2 participants