Autofocus first input in create item form (#9583)

* autofocus first input in create form

* add autofocus to translations interface

* avoid setting firstEditableField to hidden fields

* Base autofocus on prop

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Azri Kahar
2021-12-02 05:09:21 +08:00
committed by GitHub
parent 5feaac88d7
commit c4f8214ad8
3 changed files with 7 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
:model-value="firstItem"
:initial-values="firstItemInitial"
:badge="languageOptions.find((lang) => lang.value === firstLang)?.text"
:autofocus="autofocus"
@update:modelValue="updateValue($event, firstLang)"
/>
<v-divider />
@@ -82,6 +83,10 @@ export default defineComponent({
type: Array as PropType<(string | number | Record<string, any>)[] | null>,
default: null,
},
autofocus: {
type: Boolean,
default: false,
},
},
emits: ['input'],
setup(props, { emit }) {