Skip to content

Commit d85c7f3

Browse files
committed
fix(webapp): pass value:false to getInputProps on controlled hidden inputs
These hidden inputs supply their own value/defaultValue, so opt out of conform's auto-derived default (value:false) to keep them as a single controlled source and avoid a value+defaultValue mix on the same element. Submissions were already correct (getInputProps emits defaultValue, not value, for hidden inputs), this just makes the intent explicit and matches the confirm-basic-details pattern.
1 parent 822ea2f commit d85c7f3

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

apps/webapp/app/components/Feedback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function Feedback({ button, defaultValue = "bug", onOpenChange }: Feedbac
9191
) && <hr className="border-grid-dimmed" />}
9292
<Form method="post" action="/resources/feedback" {...getFormProps(form)} className="w-full">
9393
<Fieldset className="max-w-full gap-y-3">
94-
<input value={location.pathname} {...getInputProps(fields.path, { type: "hidden" })} />
94+
<input value={location.pathname} {...getInputProps(fields.path, { type: "hidden", value: false })} />
9595
<InputGroup className="max-w-full">
9696
{type === "feature" && (
9797
<InfoPanel

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,11 +965,11 @@ export function NewBranchPanel({
965965
<Fieldset className="max-w-full gap-y-3">
966966
<input
967967
value={parentEnvironment.id}
968-
{...getInputProps(parentEnvironmentId, { type: "hidden" })}
968+
{...getInputProps(parentEnvironmentId, { type: "hidden", value: false })}
969969
/>
970970
<input
971971
value={location.pathname}
972-
{...getInputProps(failurePath, { type: "hidden" })}
972+
{...getInputProps(failurePath, { type: "hidden", value: false })}
973973
/>
974974
<InputGroup className="max-w-full">
975975
<Label>Branch name</Label>

apps/webapp/app/routes/_app.orgs.$organizationSlug_.projects.new/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,9 @@ export default function Page() {
388388
<FormError id={projectName.errorId}>{projectName.errors}</FormError>
389389
</InputGroup>
390390
{canCreateV3Projects ? (
391-
<input {...getInputProps(projectVersion, { type: "hidden" })} defaultValue={"v3"} />
391+
<input {...getInputProps(projectVersion, { type: "hidden", value: false })} defaultValue={"v3"} />
392392
) : (
393-
<input {...getInputProps(projectVersion, { type: "hidden" })} defaultValue={"v2"} />
393+
<input {...getInputProps(projectVersion, { type: "hidden", value: false })} defaultValue={"v2"} />
394394
)}
395395

396396
<div className="border-t border-charcoal-700" />

apps/webapp/app/routes/resources.branches.archive.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ export function ArchiveButton({
9595
{...getFormProps(form)}
9696
className="w-full"
9797
>
98-
<input value={environment.id} {...getInputProps(environmentId, { type: "hidden" })} />
98+
<input value={environment.id} {...getInputProps(environmentId, { type: "hidden", value: false })} />
9999
<input
100100
value={`${location.pathname}${location.search}`}
101-
{...getInputProps(redirectPath, { type: "hidden" })}
101+
{...getInputProps(redirectPath, { type: "hidden", value: false })}
102102
/>
103103
<Paragraph spacing>
104104
This will <span className="text-text-bright">permanently</span> make this branch{" "}

0 commit comments

Comments
 (0)