DEV: replaces DOMNodeInserted by the better MutationObserver (#6884)

DEV: replaces DOMNodeInserted by the better MutationObserver (#6884)

diff --git a/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 b/app/assets/javascripts/discourse/lib/safari-hacks.js.es6
index 026826c..eeadb1c 100644
--- a/app/assets/javascripts/discourse/lib/safari-hacks.js.es6
+++ b/app/assets/javascripts/discourse/lib/safari-hacks.js.es6
@@ -191,7 +191,14 @@ function positioningWorkaround($fixedElement) {
     });
   }, 100);
 
-  fixedElement.addEventListener("DOMNodeInserted", checkForInputs);
+  const config = {
+    childList: true,
+    subtree: true,
+    attributes: false,
+    characterData: false
+  };
+  const observer = new MutationObserver(checkForInputs);
+  observer.observe(fixedElement, config);
 }
 
 export default positioningWorkaround;

GitHub sha: 075b2643