From 2dd47c9922b0c93a31e243fcf1f5126ee037a47e Mon Sep 17 00:00:00 2001
From: Andrew Nicols <andrew@nicols.co.uk>
Date: Mon, 30 Nov 2020 08:32:03 +0800
Subject: [PATCH 1/1] Modal movement fix

---
 lib/amd/build/modal.min.js     | Bin 9741 -> 9872 bytes
 lib/amd/build/modal.min.js.map | Bin 48392 -> 48729 bytes
 lib/amd/src/modal.js           |   6 +++++-
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/amd/build/modal.min.js b/lib/amd/build/modal.min.js
index 91677e841b5bc4dc1888c43001297ce190459b7e..c2bb749bcd8afa405270f7518eddff9b7dbd25bd 100644
GIT binary patch
diff --git a/lib/amd/build/modal.min.js.map b/lib/amd/build/modal.min.js.map
index e330a08ed15be7dea90e64e72eda60d4e06aa6e0..740d5a601a413023a9dfa8db712cfb9d9c56749b 100644
GIT binary patch
diff --git a/lib/amd/src/modal.js b/lib/amd/src/modal.js
index 118d67902e1..d725dc07640 100644
--- a/lib/amd/src/modal.js
+++ b/lib/amd/src/modal.js
@@ -103,6 +103,9 @@ define([
         this.footerJS = null;
         this.modalCount = modalCounter++;
 
+        this.attachmentPoint = document.createElement('div');
+        document.body.append(this.attachmentPoint);
+
         if (!this.root.is(SELECTORS.CONTAINER)) {
             Notification.exception({message: 'Element is not a modal container'});
         }
@@ -648,7 +651,7 @@ define([
      * @returns {jQuery}
      */
     Modal.prototype.getAttachmentPoint = function() {
-        return $(Fullscreen.getElement() || document.body);
+        return $(Fullscreen.getElement() || this.attachmentPoint);
     };
 
     /**
@@ -753,6 +756,7 @@ define([
         this.hide();
         this.root.remove();
         this.root.trigger(ModalEvents.destroyed, this);
+        this.attachmentPoint.remove();
     };
 
     /**
-- 
2.26.2

