Skip to content

Commit dda0fd1

Browse files
committed
Change autofocus strategy on AuthorCard, IdentifierCard and Keyword
1 parent e485a37 commit dda0fd1

3 files changed

Lines changed: 6 additions & 12 deletions

File tree

src/components/AuthorCardEditing.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
</div>
1313
<div class="row">
1414
<q-input
15+
autofocus
1516
bg-color="white"
1617
class="col"
1718
dense
@@ -185,7 +186,7 @@
185186

186187
<script lang="ts">
187188
/* eslint-disable @typescript-eslint/restrict-template-expressions */
188-
import { defineComponent, onMounted, ref } from 'vue'
189+
import { defineComponent, ref } from 'vue'
189190
import SchemaGuideLink from './SchemaGuideLink.vue'
190191
191192
export default defineComponent({
@@ -230,9 +231,6 @@ export default defineComponent({
230231
},
231232
setup () {
232233
const givenNamesRef = ref<HTMLElement | null>(null)
233-
onMounted(() => {
234-
givenNamesRef.value?.focus()
235-
})
236234
return {
237235
givenNamesRef
238236
}

src/components/IdentifierCardEditing.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
</q-label>
2525
</div>
2626
<q-input
27+
autofocus
2728
bg-color="white"
2829
label="Value"
2930
outlined
@@ -92,7 +93,7 @@
9293

9394
<script lang="ts">
9495
import { IdentifierTypeType } from '../types'
95-
import { computed, defineComponent, onMounted, PropType, ref } from 'vue'
96+
import { computed, defineComponent, PropType, ref } from 'vue'
9697
import SchemaGuideLink from 'src/components/SchemaGuideLink.vue'
9798
9899
export default defineComponent({
@@ -133,9 +134,6 @@ export default defineComponent({
133134
other: { label: 'identifier', anchor: '#definitionsidentifier' }
134135
}
135136
const valueRef = ref<HTMLElement | null>(null)
136-
onMounted(() => {
137-
valueRef.value?.focus()
138-
})
139137
return {
140138
valueRef,
141139
typeOptions: [

src/components/Keyword.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<div class="keyword">
33
<div class="keyword-input">
44
<q-input
5+
autofocus
56
bg-color="white"
67
dense
78
outlined
@@ -42,7 +43,7 @@
4243
</template>
4344

4445
<script lang="ts">
45-
import { defineComponent, onMounted, ref } from 'vue'
46+
import { defineComponent, ref } from 'vue'
4647
4748
export default defineComponent({
4849
name: 'KeywordCard',
@@ -62,9 +63,6 @@ export default defineComponent({
6263
},
6364
setup () {
6465
const keywordRef = ref<HTMLElement | null>(null)
65-
onMounted(() => {
66-
keywordRef.value?.focus()
67-
})
6866
return {
6967
keywordRef
7068
}

0 commit comments

Comments
 (0)