Stacked Bootstrap modals - is the backdrop cached?
Stacked Bootstrap modals - is the backdrop cached?
ButchNZ
Posts: 20Questions: 6Answers: 0
Chasing an issue at the moment with stacked modals and the backdrop appearing to be cached.
Is there any caching of the dom or events happening when using the modal as the responsive view?
This question has an accepted answers - jump to answer
Answers
Can you give a link to a page showing the issue? I'm wondering what is triggering the bootstrap modal - Responsive, Editor, Editor's nested, something else?
Allan
I've taken a different path with this so don't worry about it. I was trying to stack dynamic/unlimited modals which is not required.
To answer your question though:
I have a datatable that opens a modal (form).
In that form modal, there is another datatable using a modal for it's responsive view.
Clicking the datatable icon to open the responsive modal would add another backdrop and open the modal for the row. Great.
(I assume this opening was happening in the responsive of datatables. The code is just an icon)
The issue I had was it worked fine opening form modal, then row modal until I closed form modal.
I could open the form modal again (from a different row for eg) just fine, but opening any row modal would add a cached backdrop element.
I say "cached" as I had an incrementing counter being applied to the backdrop element. It console logged correctly but wasn't set on the element - hence me wondering if it was somehow cached.
I've explained that terribly...
Haha - nope, I'm getting it. Thanks for the explanation. Yes, Bootstrap does appear to use a cached backdrop, although it isn't something that Responsive itself is adding - it looks like it comes from Bootstrap.
If you need to come back to this, let me know and we can take a closer look at what is going on.
All the best,
Allan