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

bug: page scrolls when some components are closed after opening them #1099

Open
DarthGigi opened this issue May 17, 2024 · 1 comment
Open

Comments

@DarthGigi
Copy link

Describe the bug

When some components (in the video the DropdownMenu component is used) are closed after being opened and you have scrolled on a page, it makes the page scroll to the top and back to where you were.

This behaviour isn't quite noticeable when scroll-behavior: smooth; isn't set, however, it does still happen.

Weirdly, the Popover component does not trigger this behavior.

This also only happens on iOS Safari (and other webkit-based browsers on iOS) and doesn't happen (in normal and responsive modes) on desktop browsers, including macOS Safari.

Simulator_Screen_Recording_-_iPhone_15_Pro_-_2024-05-13_at_18.48.02.mp4

Reproduction

https://github.com/DarthGigi/shadcn-safari-mvce

Logs

No response

System Info

System:
    OS: macOS 14.5
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 715.43 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.1 - /usr/local/opt/node@20/bin/node
    npm: 10.5.2 - /usr/local/opt/node@20/bin/npm
    pnpm: 9.1.1 - /usr/local/bin/pnpm
    bun: 1.1.8 - /usr/local/bin/bun
  Browsers:
    Brave Browser: 125.1.66.110
    Chrome: 125.0.6422.61
    Safari: 17.5

Severity

annoyance

@DarthGigi
Copy link
Author

DarthGigi commented Jul 7, 2024

I'm gonna bump this issue with this comment if that's ok

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

No branches or pull requests

1 participant