Skip to content

Commit b893496

Browse files
author
yaroslav8765
committed
fix: improve input validity handling for username and password fields
1 parent 3dc104a commit b893496

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

adminforth/spa/src/views/LoginView.vue

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
name="username"
5656
id="username"
5757
ref="usernameInput"
58-
@input="clearUsernameValidity"
58+
@input="usernameInput.value?.setCustomValidity('')"
5959
@keydown.enter="passwordInput.focus()"
6060
class="w-full"
6161
placeholder="[email protected]" required />
@@ -66,7 +66,7 @@
6666
v-model="password"
6767
ref="passwordInput"
6868
autocomplete="current-password"
69-
@input="clearPasswordValidity"
69+
@input="passwordInput.value?.setCustomValidity('')"
7070
@keydown.enter="login"
7171
:type="!showPw ? 'password': 'text'" name="password" id="password" placeholder="••••••••" class="w-full" required>
7272
<template #rightIcon>
@@ -162,14 +162,6 @@ const backgroundPosition = computed(() => {
162162
return coreStore.config?.loginBackgroundPosition || '1/2';
163163
});
164164
165-
function clearPasswordValidity() {
166-
passwordInput.value?.setCustomValidity('test')
167-
}
168-
169-
function clearUsernameValidity() {
170-
usernameInput.value?.setCustomValidity('test')
171-
}
172-
173165
onBeforeMount(() => {
174166
if (localStorage.getItem('isAuthorized') === 'true') {
175167
// if route has next param, redirect

0 commit comments

Comments
 (0)