mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:16:38 -06:00
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", () => {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user