From 92e664c921ad6b39d9addd7d991a88f3ea6ea7bc Mon Sep 17 00:00:00 2001 From: GeoSot Date: Fri, 8 Oct 2021 02:46:11 +0300 Subject: [PATCH] Change check for dynamic modal --- js/src/modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/modal.js b/js/src/modal.js index 455d395f7ae8..16181775a188 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -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) }