fix: keep Tab navigation within reset-password inputs in account dialog (#9049)

* Initial plan

* fix: keep tab navigation on account dialog inputs

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot
2026-06-27 16:21:24 +08:00
committed by GitHub
parent 8f30978c8d
commit 771911a893

View File

@@ -240,6 +240,10 @@ const usernameRules = computed(() => [
const showPassword = ref(false);
const showNewPassword = ref(false);
const showConfirmPassword = ref(false);
const currentPasswordInput = ref();
const newPasswordInput = ref();
const confirmPasswordInput = ref();
const newUsernameInput = ref();
// 账户修改状态
const accountEditStatus = ref({
@@ -1796,6 +1800,7 @@ onMounted(async () => {
<v-form v-model="formValid" @submit.prevent="accountEdit">
<v-text-field
ref="currentPasswordInput"
v-model="password"
:append-inner-icon="showPassword ? 'mdi-eye-off' : 'mdi-eye'"
:type="showPassword ? 'text' : 'password'"
@@ -1804,12 +1809,14 @@ onMounted(async () => {
required
clearable
@click:append-inner="showPassword = !showPassword"
@keydown.tab.exact.prevent="newPasswordInput?.focus()"
prepend-inner-icon="mdi-lock-outline"
hide-details="auto"
class="mb-4"
></v-text-field>
<v-text-field
ref="newPasswordInput"
v-model="newPassword"
:append-inner-icon="showNewPassword ? 'mdi-eye-off' : 'mdi-eye'"
:type="showNewPassword ? 'text' : 'password'"
@@ -1818,6 +1825,8 @@ onMounted(async () => {
variant="outlined"
clearable
@click:append-inner="showNewPassword = !showNewPassword"
@keydown.tab.shift.prevent="currentPasswordInput?.focus()"
@keydown.tab.exact.prevent="confirmPasswordInput?.focus()"
prepend-inner-icon="mdi-lock-plus-outline"
:hint="t('core.header.accountDialog.form.passwordHint')"
persistent-hint
@@ -1825,6 +1834,7 @@ onMounted(async () => {
></v-text-field>
<v-text-field
ref="confirmPasswordInput"
v-model="confirmPassword"
:append-inner-icon="
showConfirmPassword ? 'mdi-eye-off' : 'mdi-eye'
@@ -1835,6 +1845,8 @@ onMounted(async () => {
variant="outlined"
clearable
@click:append-inner="showConfirmPassword = !showConfirmPassword"
@keydown.tab.shift.prevent="newPasswordInput?.focus()"
@keydown.tab.exact.prevent="newUsernameInput?.focus()"
prepend-inner-icon="mdi-lock-check-outline"
:hint="t('core.header.accountDialog.form.confirmPasswordHint')"
persistent-hint
@@ -1842,11 +1854,13 @@ onMounted(async () => {
></v-text-field>
<v-text-field
ref="newUsernameInput"
v-model="newUsername"
:rules="usernameRules"
:label="t('core.header.accountDialog.form.newUsername')"
variant="outlined"
clearable
@keydown.tab.shift.prevent="confirmPasswordInput?.focus()"
prepend-inner-icon="mdi-account-edit-outline"
:hint="t('core.header.accountDialog.form.usernameHint')"
persistent-hint