FIX: attempts to observe preview mutation asap (#14590)

FIX: attempts to observe preview mutation asap (#14590)

diff --git a/app/assets/javascripts/discourse/app/components/d-editor.js b/app/assets/javascripts/discourse/app/components/d-editor.js
index a67af2c..ac3e9a1 100644
--- a/app/assets/javascripts/discourse/app/components/d-editor.js
+++ b/app/assets/javascripts/discourse/app/components/d-editor.js
@@ -263,6 +263,8 @@ export default Component.extend(TextareaTextManipulation, {
   didInsertElement() {
     this._super(...arguments);
 
+    this._previewMutationObserver = this._disablePreviewTabIndex();
+
     this._textarea = this.element.querySelector("textarea.d-editor-input");
     this._$textarea = $(this._textarea);
     this._applyEmojiAutocomplete(this._$textarea);
@@ -281,8 +283,6 @@ export default Component.extend(TextareaTextManipulation, {
       });
     });
 
-    this._previewMutationObserver = this._disablePreviewTabIndex();
-
     // disable clicking on links in the preview
     $(this.element.querySelector(".d-editor-preview")).on(
       "click.preview",

GitHub sha: b59c41925332da8a81450ef6a907ecc850deab20

This commit appears in #14590 which was approved by OsamaSayegh. It was merged by jjaffeux.