From 0af344b4e3c6aa09eaf7a5e879f421078db8d440 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Wed, 6 Jul 2022 18:23:05 +0200 Subject: [PATCH] refactor: use autofocus parameter Using the `ref` seems to be broken but using the autofocus parameter seems to fix it. --- .../client/src/components/user-select-dialog.vue | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/client/src/components/user-select-dialog.vue b/packages/client/src/components/user-select-dialog.vue index b34d21af0..972d35348 100644 --- a/packages/client/src/components/user-select-dialog.vue +++ b/packages/client/src/components/user-select-dialog.vue @@ -11,7 +11,7 @@
- + @@ -70,15 +70,8 @@ let host = $ref(''); let users: misskey.entities.UserDetailed[] = $ref([]); let recentUsers: misskey.entities.UserDetailed[] = $ref([]); let selected: misskey.entities.UserDetailed | null = $ref(null); -let usernameEl: HTMLElement = $ref(); let dialogEl = $ref(); -const focus = () => { - if (usernameEl) { - usernameEl.focus(); - } -}; - const search = () => { if (username === '' && host === '') { users = []; @@ -112,12 +105,6 @@ const cancel = () => { }; onMounted(() => { - focus(); - - nextTick(() => { - focus(); - }); - os.api('users/show', { userIds: defaultStore.state.recentlyUsedUsers, }).then(users => {