FIX: makes focust text area after complete more resilient (#9879)

This commit is contained in:
Joffrey JAFFEUX 2020-05-26 16:27:02 +02:00 committed by GitHub
parent 3d20a1143b
commit 253a185769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -898,8 +898,16 @@ export default Component.extend({
// ensures textarea scroll position is correct
_focusTextArea() {
const textarea = this.element.querySelector("textarea.d-editor-input");
schedule("afterRender", () => {
if (!this.element || this.isDestroying || this.isDestroyed) {
return;
}
const textarea = this.element.querySelector("textarea.d-editor-input");
if (!textarea) {
return;
}
textarea.blur();
textarea.focus();
});