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

Opening Dialog should not scroll the page #1951

Closed
silverwind opened this issue Mar 31, 2024 · 3 comments
Closed

Opening Dialog should not scroll the page #1951

silverwind opened this issue Mar 31, 2024 · 3 comments
Assignees
Labels
bug Things that aren't working right in the library.

Comments

@silverwind
Copy link

silverwind commented Mar 31, 2024

Describe the bug

Maybe it's only a issue on the demo page, but I noticed Dialog scrolls the page to offset 0 every time it's being opened, which is disruptive to the user.

To Reproduce

  1. Go to https://shoelace.style/components/dialog
  2. Scroll down a bit
  3. Click on 'Open Dialog'
  4. Notice that the page in the background scrolls to offset 0

Browser / OS

  • OS: MacOS 14
  • Browser: Firefox, Chrome
  • Browser version: latest
@silverwind silverwind added the bug Things that aren't working right in the library. label Mar 31, 2024
@silverwind silverwind changed the title Opening Dialog should not scroll the page behind it Opening Dialog should not scroll the page Apr 13, 2024
@tylantz
Copy link

tylantz commented Apr 15, 2024

The same behaviour exists on drawers

To Reproduce

Browser / OS

  • OS: Win 11
  • Browser: Firefox, Chrome, Edge
  • Browser version: latest

@KonnorRogers
Copy link
Collaborator

Should be fixed in #1967

@KonnorRogers
Copy link
Collaborator

Wow. This was actually a docs site only issue and required a very exact series of events:

https://twitter.com/RogersKonnor/status/1785043661882818620

html, body {
  height: 100%;
}

body { overflow-x: hidden }

.sl-scroll-lock {
  overflow: hidden;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

3 participants