A platform for community discussion. Free, open, simple.
DEV: Fix flaky d-editor test (#13005)
Penar Musaraj81616fbdc46c
diff --git a/app/assets/javascripts/discourse/app/components/d-editor.js b/app/assets/javascripts/discourse/app/components/d-editor.jsindex ae1a5666b00..345777759fd 100644--- a/app/assets/javascripts/discourse/app/components/d-editor.js+++ b/app/assets/javascripts/discourse/app/components/d-editor.js@@ -438,7 +438,7 @@ export default Component.extend({}schedule("afterRender", () => {- if (this._state !== "inDOM") {+ if (this._state !== "inDOM" || !this.element) {return;}const $preview = $(this.element.querySelector(".d-editor-preview"));@@ -653,6 +653,10 @@ export default Component.extend({_selectText(from, length, opts = { scroll: true }) {next(() => {+ if (!this.element) {+ return;+ }+const textarea = this.element.querySelector("textarea.d-editor-input");const $textarea = $(textarea);textarea.selectionStart = from;