66 >
77 <div class =" row" >
88 <q-input
9+ tabindex =" 1"
910 bg-color =" white"
1011 class =" col"
1112 dense
1718 v-bind:error =" givenNamesError.hasError"
1819 v-bind:error-message =" givenNamesError.messages.join(', ')"
1920 v-on:update:modelValue =" $emit('update', 'givenNames', $event)"
21+ ref =" givenNamesRef"
2022 />
2123 </div >
2224 <div class =" row" >
153155
154156<script lang="ts">
155157/* eslint-disable @typescript-eslint/restrict-template-expressions */
156- import { computed , defineComponent } from ' vue'
158+ import { computed , defineComponent , onMounted , ref , nextTick } from ' vue'
157159import { getMyErrors } from ' src/store/validator'
158160import { authorErrors } from ' src/author-errors'
159161
@@ -198,7 +200,12 @@ export default defineComponent({
198200 }
199201 },
200202 setup (props ) {
203+ const givenNamesRef = ref <HTMLElement | null >(null )
204+ onMounted (() => {
205+ givenNamesRef .value ?.focus ()
206+ })
201207 return {
208+ givenNamesRef ,
202209 givenNamesError: computed (() => getMyErrors (` /authors/${props .index }/given-names ` )),
203210 nameParticleError: computed (() => getMyErrors (` /authors/${props .index }/name-particle ` )),
204211 familyNamesError: computed (() => getMyErrors (` /authors/${props .index }/family-names ` )),
@@ -207,6 +214,7 @@ export default defineComponent({
207214 affiliationError: computed (() => getMyErrors (` /authors/${props .index }/affiliation ` )),
208215 orcidError: computed (() => getMyErrors (` /authors/${props .index }/orcid ` )),
209216 authorErrors: computed (() => authorErrors (props .index ))
217+
210218 }
211219 },
212220 emits: [' closePressed' , ' removePressed' , ' update' , ' moveUp' , ' moveDown' ]
0 commit comments