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

Body styles not resetting correctly for multiple Dialogs #3746

Open
endrebmedhus opened this issue Mar 3, 2025 · 1 comment
Open

Body styles not resetting correctly for multiple Dialogs #3746

endrebmedhus opened this issue Mar 3, 2025 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@endrebmedhus
Copy link

Describe the bug

The styling in the body is not cleared correctly when closing a Dialog, if multiple Dialogs have been open simultaneously. This means that the body will have overflow: "hidden", so all scroll is disabled.

Steps to reproduce the bug

  1. Open a Dialog.
  2. Open another Dialog (they don't need to be nested in the HTML).
  3. Close one Dialog.
  4. Close the other dialog.

The body now still has style="overflow: hidden; padding-right: 15px;".

Expected behavior

I would expect the body's style to have returned to normal.

Specifications

  • Version: 0.42.5
  • Browser: Microsoft Edge
  • OS: Windows 11

Additional context

To try to get around this problem, I originally tryed to reset the styles manually in the onClose-handler of the last dialog i closed. The styles where then reset, but then set back to "overflow: hidden; padding-right: 15px;".

@endrebmedhus endrebmedhus added the 🐛 bug Something isn't working label Mar 3, 2025
@oddvernes
Copy link
Collaborator

Thanks, we need to take a look at the useHideBodyScroll hook and make it more robust if it is triggered again while already active. Having two dialogs open at the same time is not really something that is supposed to happen but I can see some legit scenarios where it could happen anyway so it is something we need to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants