From 6419173d6178e589fb178cfcf6723aed10b2bd13 Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Tue, 11 Feb 2025 10:29:16 -0500 Subject: [PATCH] Adding fix to password validation --- resources/js/pages/settings/Password.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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(); + } } }, });