fix(CustomPickerElement): Autofocus

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2023-03-21 14:15:17 +01:00
parent 28a75d4717
commit e81db393ce
1 changed files with 7 additions and 1 deletions

View File

@ -9,7 +9,8 @@
<h2>
{{ t('bookmarks', 'Bookmarks') }}
</h2>
<NcSearch :provider="{search_providers_ids: ['bookmarks'], title: t('bookmarks', 'Bookmarks')}"
<NcSearch ref="picker"
:provider="{search_providers_ids: ['bookmarks'], title: t('bookmarks', 'Bookmarks')}"
@cancel="cancelSearch"
@submit="submitLink" />
</div>
@ -25,6 +26,11 @@ export default {
components: {
NcSearch,
},
mounted() {
setTimeout(() => {
this.$refs.picker?.focus()
}, 300)
},
methods: {
cancelSearch() {
this.$emit('cancel')