Created by: weaverryan
Hi there!
I'm using Turbo, where the entire body
element is swapped out at times. This causes a bug with Backdrop, as it stores the original body
element in the Default
object. This is the flow:
- Open a Modal / Backdrop
- Navigate to another page (i.e. swap the
body
for a newbody
Element) - Open another Modal / Backdrop
On (3), the Backdrop
will append itself to the original body
Element from (1), not the new body element.
Also, the default is unnecessary: in _getConfig()
, if config.rootElement
is falsy, then it already defaults to document.body
(which is why I didn't add any tests: there are tests already to make sure the rootElement
can be configured):
Please let me know if any tweaks are needed.
Thanks!