From f5265a589e3f12083acfbe27358f217cd4ee21cb Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Wed, 25 Feb 2026 17:53:15 +0800 Subject: [PATCH] Fix form validation: red outline only on submit, add required asterisks - Remove instant invalid:ring/border from Input component (was showing red outline on empty required fields before any interaction) - Add CSS rule: form[data-submitted] input:invalid shows red border - Add global submit listener in main.tsx that sets data-submitted on forms - Add required prop to Labels missing asterisks: PersonForm (First Name), LocationForm (Location Name), CalendarForm (Name), LockScreen (Username, Password, Confirm Password) Co-Authored-By: Claude Opus 4.6 --- frontend/src/components/auth/LockScreen.tsx | 6 +++--- frontend/src/components/calendar/CalendarForm.tsx | 2 +- frontend/src/components/locations/LocationForm.tsx | 2 +- frontend/src/components/people/PersonForm.tsx | 2 +- frontend/src/components/ui/input.tsx | 2 +- frontend/src/index.css | 8 ++++++++ frontend/src/main.tsx | 8 ++++++++ 7 files changed, 23 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/auth/LockScreen.tsx b/frontend/src/components/auth/LockScreen.tsx index 7320f3a..961574a 100644 --- a/frontend/src/components/auth/LockScreen.tsx +++ b/frontend/src/components/auth/LockScreen.tsx @@ -204,7 +204,7 @@ export default function LockScreen() {
- +
- + - +
- + {/* Location Name */}
- +
- + ( { + if (e.target instanceof HTMLFormElement) { + e.target.setAttribute('data-submitted', ''); + } +}, true); + const queryClient = new QueryClient({ defaultOptions: { queries: {