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);
|
return emojiUnescape(emoji);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
focusEmojiButton() {
|
||||||
|
document.querySelector(".btn-emoji")?.focus();
|
||||||
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
blur() {
|
blur() {
|
||||||
this.set("isFocused", false);
|
this.set("isFocused", false);
|
||||||
|
@ -35,9 +39,7 @@ export default class UserStatusPicker extends Component {
|
||||||
this.set("status.emoji", emoji);
|
this.set("status.emoji", emoji);
|
||||||
this.set("emojiPickerIsActive", false);
|
this.set("emojiPickerIsActive", false);
|
||||||
|
|
||||||
scheduleOnce("afterRender", () => {
|
scheduleOnce("afterRender", this, this.focusEmojiButton);
|
||||||
document.querySelector(".btn-emoji")?.focus();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
|
@ -492,7 +492,13 @@ export default class ComposerService extends Service {
|
||||||
@action
|
@action
|
||||||
async focusComposer(opts = {}) {
|
async focusComposer(opts = {}) {
|
||||||
await this._openComposerForFocus(opts);
|
await this._openComposerForFocus(opts);
|
||||||
this._focusAndInsertText(opts.insertText);
|
|
||||||
|
scheduleOnce(
|
||||||
|
"afterRender",
|
||||||
|
this,
|
||||||
|
this._focusAndInsertText,
|
||||||
|
opts.insertText
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async _openComposerForFocus(opts) {
|
async _openComposerForFocus(opts) {
|
||||||
|
@ -525,13 +531,11 @@ export default class ComposerService extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
_focusAndInsertText(insertText) {
|
_focusAndInsertText(insertText) {
|
||||||
scheduleOnce("afterRender", () => {
|
|
||||||
document.querySelector("textarea.d-editor-input")?.focus();
|
document.querySelector("textarea.d-editor-input")?.focus();
|
||||||
|
|
||||||
if (insertText) {
|
if (insertText) {
|
||||||
this.model.appendText(insertText, null, { new_line: true });
|
this.model.appendText(insertText, null, { new_line: true });
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
Loading…
Reference in New Issue