From 58dc9068dae76504aa8cb72b2f1b7125388dbd6e Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 15 Dec 2024 11:20:13 +0200 Subject: [PATCH] New tournament/calendar form event report error instead of erroring out --- app/features/calendar/routes/calendar.new.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/features/calendar/routes/calendar.new.tsx b/app/features/calendar/routes/calendar.new.tsx index 88b5fdd13..23a2e974c 100644 --- a/app/features/calendar/routes/calendar.new.tsx +++ b/app/features/calendar/routes/calendar.new.tsx @@ -181,6 +181,12 @@ function EventForm() { React.useState(false); const handleSubmit = () => { + const isValid = ref.current?.checkValidity(); + if (!isValid) { + ref.current?.reportValidity(); + return; + } + const formData = new FormData(ref.current!); // if "avatarImgId" it means they want to reuse an existing avatar