question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

reapplying Modal applies additional background fade

See original GitHub issue

Hello

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:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
danijelGombaccommented, Dec 5, 2017

Why you don’t hide the modal before show it again?

0reactions
brettwinterscommented, Oct 21, 2018

I worked around this issue by doing an asynchronous postback inside the modal content.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found