Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions resources/js/pages/settings/Password.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const breadcrumbItems: BreadcrumbItem[] = [
},
];

const passwordInput = ref<HTMLInputElement | null>(null);
const currentPasswordInput = ref<HTMLInputElement | null>(null);
const passwordInput = ref<HTMLInputElement>();
const currentPasswordInput = ref<HTMLInputElement>();

const form = useForm({
current_password: '',
Expand All @@ -41,12 +41,16 @@ const updatePassword = () => {
onError: (errors: any) => {
if (errors.password) {
form.reset('password', 'password_confirmation');
passwordInput.value?.focus();
if (passwordInput.value instanceof HTMLInputElement) {
passwordInput.value.focus();
}
}

if (errors.current_password) {
form.reset('current_password');
currentPasswordInput.value?.focus();
if (currentPasswordInput.value instanceof HTMLInputElement) {
currentPasswordInput.value.focus();
}
}
},
});
Expand Down