Skip to content

Commit

Permalink
auto focus pin code input when open desktop unlock page
Browse files Browse the repository at this point in the history
  • Loading branch information
mayswind committed Jul 2, 2023
1 parent 748cf68 commit 7cf53ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/common/PinCodeInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:ref="`pin-code-input-${index}`"
:value="codes[index].value"
:type="codes[index].inputType"
:autofocus="autofocus && index === 0 ? 'autofocus' : undefined"
@focus="codes[index].focused = true"
@blur="codes[index].focused = false"
@keydown="onKeydown(index, $event)"
Expand All @@ -21,6 +22,7 @@
export default {
props: [
'modelValue',
'autofocus',
'secure',
'length'
],
Expand Down
3 changes: 2 additions & 1 deletion src/views/desktop/UnlockPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
<v-form>
<v-row>
<v-col cols="12">
<pin-code-input :secure="true" :length="6" v-model="pinCode" @pincode:confirm="unlockByPin" />
<pin-code-input :autofocus="true" :secure="true" :length="6"
v-model="pinCode" @pincode:confirm="unlockByPin" />
</v-col>

<v-col cols="12">
Expand Down

0 comments on commit 7cf53ac

Please sign in to comment.