Drop the nested form now twui guards a missing one

twui 0.1.5 makes Form's change handler tolerate a field with no form
ancestor, so the modal's own form is no longer needed to keep a change in
it from throwing.
This commit is contained in:
2026-10-22 05:04:40 +01:00
parent 89101d0e05
commit 2d108b05bf
3 changed files with 5 additions and 11 deletions
@@ -1,6 +1,5 @@
import { useState } from "react";
import Modal from "@moduletrace/twui/elements/Modal";
import Form from "@moduletrace/twui/form/Form";
import H2 from "@moduletrace/twui/layout/H2";
import Span from "@moduletrace/twui/layout/Span";
import Stack from "@moduletrace/twui/layout/Stack";
@@ -102,12 +101,7 @@ export default function HarnessParameterModal({
and repeatable.
</Span>
</Stack>
{/*
A form of its own: twui's Form reads the closest form on change,
so inside the page's form (this renders in a portal) a change
here would blow up reading the modal's wrapper.
*/}
<Form className="w-full gap-4! items-stretch" onSubmit={(e) => e.preventDefault()}>
<Stack className="w-full gap-4! items-stretch">
<HarnessParameterFields
id={id}
harness={harness}
@@ -115,7 +109,7 @@ export default function HarnessParameterModal({
params={params}
onChange={onChange}
/>
</Form>
</Stack>
</Modal>
);
}