UX: ensures user-status-picker’s input is autofocused (#23083)
I tried using "autofocus=true" first but it was not reliable in tests.
This commit is contained in:
parent
04c9c81cda
commit
ea6a89397a
|
@ -15,6 +15,8 @@ export default class UserStatusPicker extends Component {
|
|||
if (!this.status) {
|
||||
this.set("status", {});
|
||||
}
|
||||
|
||||
document.querySelector(".user-status-description")?.focus();
|
||||
}
|
||||
|
||||
@computed("status.emoji")
|
||||
|
|
|
@ -26,6 +26,12 @@ module("Integration | Component | user-status-picker", function (hooks) {
|
|||
);
|
||||
});
|
||||
|
||||
test("it focuses the input on insert", async function (assert) {
|
||||
await render(hbs`<UserStatusPicker />`);
|
||||
|
||||
assert.dom(".user-status-description").isFocused();
|
||||
});
|
||||
|
||||
test("it picks emoji", async function (assert) {
|
||||
const status = {
|
||||
emoji: "tooth",
|
||||
|
|
Loading…
Reference in New Issue