summaryrefslogtreecommitdiff
path: root/packages/client/src/components
diff options
context:
space:
mode:
authorJohann150 <johann.galle@protonmail.com>2022-07-06 18:23:05 +0200
committerJohann150 <johann.galle@protonmail.com>2022-07-06 18:23:05 +0200
commitac6b8f348028fcee95fc73dec439905ebf6775e6 (patch)
tree6a106d864df83f1c20c0695a9939f3e82e926334 /packages/client/src/components
parentchore(client): tweak style (diff)
downloadsharkey-ac6b8f348028fcee95fc73dec439905ebf6775e6.tar.gz
sharkey-ac6b8f348028fcee95fc73dec439905ebf6775e6.tar.bz2
sharkey-ac6b8f348028fcee95fc73dec439905ebf6775e6.zip
refactor: use autofocus parameter
Using the `ref` seems to be broken but using the autofocus parameter seems to fix it.
Diffstat (limited to 'packages/client/src/components')
-rw-r--r--packages/client/src/components/user-select-dialog.vue15
1 files changed, 1 insertions, 14 deletions
diff --git a/packages/client/src/components/user-select-dialog.vue b/packages/client/src/components/user-select-dialog.vue
index b34d21af07..972d353486 100644
--- a/packages/client/src/components/user-select-dialog.vue
+++ b/packages/client/src/components/user-select-dialog.vue
@@ -11,7 +11,7 @@
<div class="tbhwbxda">
<div class="form">
<FormSplit :min-width="170">
- <MkInput ref="usernameEl" v-model="username" @update:modelValue="search">
+ <MkInput v-model="username" :autofocus="true" @update:modelValue="search">
<template #label>{{ $ts.username }}</template>
<template #prefix>@</template>
</MkInput>
@@ -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 => {