reapplying Modal applies additional background fade
See original GitHub issueHello
I’m using asp.net. When I postback, I need to re-show the modal
$('#xxxx').modal('show');
The model is re-shown, but the background darkening is re-applied. So if you repeat the “show” the background becomes black.
To solve this issue, if I re-show the model, I first need to remove the class
$('.modal-backdrop').removeClass('modal-backdrop');
Why can’t Bootstrap check to see if the class is already applied before adding the class?
Regards
Brett
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Separate background fade on Bootstrap Modal - Stack Overflow
What you should be doing is giving that modal an additional class to style is accordingly. For example, you could name your modal...
Read more >Modal Dialog Example | APG | WAI - W3C
Applying the aria-modal property to the dialog element replaces the technique of using aria-hidden on the background for informing assistive ...
Read more >Bootstrap Modal Position - Visual LightBox
A good idea would certainly be additionally bring in the .fade class just to obtain smooth appearing transition upon the showcase of the...
Read more >backdrop-filter | CSS-Tricks
The backdrop-filter property allows you to eliminate this extra “background” element and apply filters to the backdrop directly:
Read more >4 Ways To Change A Background Color In Photoshop
Here you'll learn how to add a white background to your photo, change the color of white backgrounds, as well as add gradient...
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 Free
Top 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
Why you don’t hide the modal before show it again?
I worked around this issue by doing an asynchronous postback inside the modal content.