From 5426657b2e475dc51eb89b66870ff1d8144ae1ee Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Sat, 28 Feb 2026 01:37:57 +0800 Subject: [PATCH] Fix login error alert disappearing due to browser autofill After a failed login, the browser's password manager fires onChange events on the username/password inputs (clearing or resetting them). The onChange handlers were calling setLoginError(null), which wiped the error alert immediately after it appeared. Fix: remove setLoginError(null) from input onChange handlers. The error now clears at the start of the next submit attempt via the existing setLoginError(null) in handleCredentialSubmit. Co-Authored-By: Claude Opus 4.6 --- frontend/src/components/auth/LockScreen.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/auth/LockScreen.tsx b/frontend/src/components/auth/LockScreen.tsx index aee902d..eb9cc1c 100644 --- a/frontend/src/components/auth/LockScreen.tsx +++ b/frontend/src/components/auth/LockScreen.tsx @@ -496,7 +496,7 @@ export default function LockScreen() { id="username" type="text" value={username} - onChange={(e) => { setUsername(e.target.value); setLoginError(null); }} + onChange={(e) => setUsername(e.target.value)} placeholder="Enter username" required autoFocus @@ -509,7 +509,7 @@ export default function LockScreen() { id="password" type="password" value={password} - onChange={(e) => { setPassword(e.target.value); setLoginError(null); }} + onChange={(e) => setPassword(e.target.value)} placeholder={isSetup ? 'Create a password' : 'Enter password'} required autoComplete={isSetup ? 'new-password' : 'current-password'}