diff --git a/resources/js/pages/settings/Password.vue b/resources/js/pages/settings/Password.vue index 4c54d91b..13444b17 100644 --- a/resources/js/pages/settings/Password.vue +++ b/resources/js/pages/settings/Password.vue @@ -25,8 +25,8 @@ const breadcrumbItems: BreadcrumbItem[] = [ }, ]; -const passwordInput = ref(null); -const currentPasswordInput = ref(null); +const passwordInput = ref(); +const currentPasswordInput = ref(); const form = useForm({ current_password: '', @@ -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(); + } } }, });