From 7cb3a906b2bc76320f97ae30fc3e7a2acf8c760b Mon Sep 17 00:00:00 2001 From: DoubleCookies <12849336+DoubleCookies@users.noreply.github.com> Date: Fri, 16 Sep 2022 11:32:58 +0300 Subject: [PATCH 1/2] other default value + empty onChange --- app/routes/u.$identifier/builds/new.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/routes/u.$identifier/builds/new.tsx b/app/routes/u.$identifier/builds/new.tsx index 18fd16072..186a0c06f 100644 --- a/app/routes/u.$identifier/builds/new.tsx +++ b/app/routes/u.$identifier/builds/new.tsx @@ -379,8 +379,9 @@ function Abilities() { value={ abilities.flat().every((a) => a !== "UNKNOWN") ? JSON.stringify(abilities) - : undefined + : [] } + onChange={() => {}} required /> Date: Fri, 16 Sep 2022 16:46:56 +0300 Subject: [PATCH 2/2] Add comment clarifying empty onChange --- app/routes/u.$identifier/builds/new.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/routes/u.$identifier/builds/new.tsx b/app/routes/u.$identifier/builds/new.tsx index 186a0c06f..e39757259 100644 --- a/app/routes/u.$identifier/builds/new.tsx +++ b/app/routes/u.$identifier/builds/new.tsx @@ -381,7 +381,9 @@ function Abilities() { ? JSON.stringify(abilities) : [] } - onChange={() => {}} + // empty onChange is because otherwise it will give a React error in console + // readOnly can't be set as then validation is not active + onChange={() => null} required />