radix-vue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
3.51k stars 203 forks source link

[Bug]: Responsive Dialog removes scroll after resize #584

Closed AlexXanderGrib closed 1 week ago

AlexXanderGrib commented 1 month ago

Reproduction

https://www.shadcn-vue.com/docs/components/drawer.html

Describe the bug

Reproduction steps

  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

Simple fix

watch(isOpen, open => {
  if (!open) {
    document.body.removeAttribute('style');
  }
});

Related

radix-vue/vaul-vue#51

System Info

System:
    OS: Linux 6.8 Ubuntu 24.04 LTS 24.04 LTS (Noble Numbat)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-11370H @ 3.30GHz
    Memory: 3.71 GB / 15.41 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 20.5.1 - /usr/bin/node
    Yarn: 3.6.1 - /usr/bin/yarn
    npm: 10.2.5 - /usr/bin/npm
    pnpm: 8.15.1 - /usr/bin/pnpm
    bun: 1.0.0 - ~/.bun/bin/bun
  Browsers:
    Chrome: 125.0.6422.112

Contributes

zernonia commented 2 weeks ago

Issue should be fixed in https://github.com/radix-vue/vaul-vue/releases/tag/vaul-vue%400.2.0 😁