fix: TypeError cannot read property 'focus' of undefined (#9765)

This commit is contained in:
Sivin Varghese
2024-07-15 19:33:16 +05:30
committed by GitHub
parent ebf3b46f0d
commit 554388bff3

View File

@@ -4,12 +4,12 @@
class="emoji-dialog bg-white shadow-lg dark:bg-slate-900 rounded-md border border-solid border-slate-75 dark:border-slate-800/50 box-content h-[300px] absolute right-0 -top-[95px] w-80 z-20" class="emoji-dialog bg-white shadow-lg dark:bg-slate-900 rounded-md border border-solid border-slate-75 dark:border-slate-800/50 box-content h-[300px] absolute right-0 -top-[95px] w-80 z-20"
> >
<div class="flex flex-col"> <div class="flex flex-col">
<div class="emoji-search--wrap flex gap-2"> <div class="flex gap-2 emoji-search--wrap">
<input <input
ref="searchbar" ref="searchbar"
v-model="search" v-model="search"
type="text" type="text"
class="emoji-search--input focus:box-shadow-blue dark:focus:box-shadow-dark" class="emoji-search--input focus:box-shadow-blue dark:focus:box-shadow-dark !mb-0"
:placeholder="$t('EMOJI.PLACEHOLDER')" :placeholder="$t('EMOJI.PLACEHOLDER')"
/> />
<woot-button <woot-button
@@ -174,7 +174,9 @@ export default {
return categoryItem ? categoryItem.emojis[0].emoji : ''; return categoryItem ? categoryItem.emojis[0].emoji : '';
}, },
focusSearchInput() { focusSearchInput() {
this.$refs.searchbar.focus(); this.$nextTick(() => {
this.$refs.searchbar.focus();
});
}, },
}, },
}; };