fix: use empty template by default when pressing enter

Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
This commit is contained in:
Elizabeth Danzberger 2024-08-20 17:37:48 -04:00 committed by Andy Scherzinger
parent f81a3493a1
commit 1d9066cc68
2 changed files with 10 additions and 0 deletions

View file

@ -6,6 +6,7 @@
<template>
<li class="template-picker__item">
<input :id="id"
ref="input"
:checked="checked"
type="radio"
class="radio"
@ -124,6 +125,9 @@ export default {
onFailure() {
this.failedPreview = true
},
focus() {
this.$refs.input?.focus()
},
},
}
</script>

View file

@ -17,6 +17,7 @@
<!-- Templates list -->
<ul class="templates-picker__list">
<TemplatePreview v-bind="emptyTemplate"
ref="emptyTemplatePreview"
:checked="checked === emptyTemplate.fileid"
@check="onCheck" />
@ -179,6 +180,11 @@ export default defineComponent({
// Else, open the picker
this.opened = true
// Set initial focus to the empty template preview
this.$nextTick(() => {
this.$refs.emptyTemplatePreview?.focus()
})
},
/**