]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Change check for dynamic modal
authorGeoSot <geo.sotis@gmail.com>
Thu, 7 Oct 2021 23:46:11 +0000 (02:46 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Thu, 25 Nov 2021 17:23:49 +0000 (19:23 +0200)
js/src/modal.js

index 455d395f7ae823c2ecd1de2d33e77e781ba212dd..16181775a1884b17093e08d58d912c4dad0896d5 100644 (file)
@@ -200,8 +200,8 @@ class Modal extends BaseComponent {
   }
 
   _showElement(relatedTarget) {
-    if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
-      // Don't move modal's DOM position
+    // try to append dynamic modal
+    if (!document.body.contains(this._element)) {
       document.body.append(this._element)
     }