DEV: Fix `ember/no-incorrect-calls-with-inline-anonymous-functions` (#24010)
This commit is contained in:
parent
754d13f5fa
commit
b45720b158
|
@ -25,6 +25,10 @@ export default class UserStatusPicker extends Component {
|
|||
return emojiUnescape(emoji);
|
||||
}
|
||||
|
||||
focusEmojiButton() {
|
||||
document.querySelector(".btn-emoji")?.focus();
|
||||
}
|
||||
|
||||
@action
|
||||
blur() {
|
||||
this.set("isFocused", false);
|
||||
|
@ -35,9 +39,7 @@ export default class UserStatusPicker extends Component {
|
|||
this.set("status.emoji", emoji);
|
||||
this.set("emojiPickerIsActive", false);
|
||||
|
||||
scheduleOnce("afterRender", () => {
|
||||
document.querySelector(".btn-emoji")?.focus();
|
||||
});
|
||||
scheduleOnce("afterRender", this, this.focusEmojiButton);
|
||||
}
|
||||
|
||||
@action
|
||||
|
|
|
@ -492,7 +492,13 @@ export default class ComposerService extends Service {
|
|||
@action
|
||||
async focusComposer(opts = {}) {
|
||||
await this._openComposerForFocus(opts);
|
||||
this._focusAndInsertText(opts.insertText);
|
||||
|
||||
scheduleOnce(
|
||||
"afterRender",
|
||||
this,
|
||||
this._focusAndInsertText,
|
||||
opts.insertText
|
||||
);
|
||||
}
|
||||
|
||||
async _openComposerForFocus(opts) {
|
||||
|
@ -525,13 +531,11 @@ export default class ComposerService extends Service {
|
|||
}
|
||||
|
||||
_focusAndInsertText(insertText) {
|
||||
scheduleOnce("afterRender", () => {
|
||||
document.querySelector("textarea.d-editor-input")?.focus();
|
||||
document.querySelector("textarea.d-editor-input")?.focus();
|
||||
|
||||
if (insertText) {
|
||||
this.model.appendText(insertText, null, { new_line: true });
|
||||
}
|
||||
});
|
||||
if (insertText) {
|
||||
this.model.appendText(insertText, null, { new_line: true });
|
||||
}
|
||||
}
|
||||
|
||||
@action
|
||||
|
|
Loading…
Reference in New Issue