Multiple modals scrolling bug
See original GitHub issuedimmable dimmed
are deleted from body
when the second modal is closed
Steps
- Scroll modal
- Open second modal
- Scroll modal
- Close second modal
- Try to scroll modal
Expected Result
The first modal should be scrollable
<body class="dimmable dimmed scrolling">
Actual Result
First Modal is not longer scrollabel
<body class="scrolling">
Version
tested in 0.64.0 & 0.63.5
Testcase
Issue Analytics
- State:
- Created 7 years ago
- Reactions:16
- Comments:16 (7 by maintainers)
Top Results From Across the Web
Scrolling issues with multiple bootstrap modals
I played around with closing the background modal with js first (but that messes up scrolling on the second modal). It appears that...
Read more >Multiple bootstrap modals scrolling issue. #15992
I have my main page where i already have scrolling. Where i am opening one bootstrap dialogue which is also bigger and the...
Read more >If multiple modals, scroll lock fails to clear after closing last ...
Problem /Motivation When multiple modals are opened, the body scroll lock JS only removes the scroll lock on the last modal.
Read more >Stop scrolling background while use multiple modals
Hi everyone, this is my first post about Webflow and I wanted to know if I can stop background from scrolling while a...
Read more >Quick Fix: Scrolling and Focus when multiple bootstrap ...
Still if you face issue when multiple modals are simultaneously open, adding this would fix: $('.modal').on("hidden.bs.modal", function (e) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
my temporary fix
Yep, this makes sense. I think it is time to consider a stack for managing things like overlays and document level keybindings.
Another example of this issue is pressing ESC. This will close all Dropdowns, Popups, Modals, and anything else that has a document level listener for ESC. Ideally, we’d have a stack of listeners and only the most recent would be invoked and removed. That way, only the top level component unmounts. This would allow opening/closing a Popup inside of a Modal without also closing the Modal.
The stack could also be used here to keep the classes on the body until there were no more page dimmers in the stack.
@jcarbo / @layershifter have you run into needs that would be well served by a stack or top-level Provider component for managing state such as listeners and multiple Portals?