DEV: Fix flaky d-editor test (#13005)
This commit is contained in:
parent
c473cde997
commit
81616fbdc4
|
@ -438,7 +438,7 @@ export default Component.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
schedule("afterRender", () => {
|
schedule("afterRender", () => {
|
||||||
if (this._state !== "inDOM") {
|
if (this._state !== "inDOM" || !this.element) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const $preview = $(this.element.querySelector(".d-editor-preview"));
|
const $preview = $(this.element.querySelector(".d-editor-preview"));
|
||||||
|
@ -653,6 +653,10 @@ export default Component.extend({
|
||||||
|
|
||||||
_selectText(from, length, opts = { scroll: true }) {
|
_selectText(from, length, opts = { scroll: true }) {
|
||||||
next(() => {
|
next(() => {
|
||||||
|
if (!this.element) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const textarea = this.element.querySelector("textarea.d-editor-input");
|
const textarea = this.element.querySelector("textarea.d-editor-input");
|
||||||
const $textarea = $(textarea);
|
const $textarea = $(textarea);
|
||||||
textarea.selectionStart = from;
|
textarea.selectionStart = from;
|
||||||
|
|
Loading…
Reference in New Issue