Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function Upgradable({
}: ConcurrencyResult) {
const lastSubmission = useActionData();
const [form, { environments: formEnvironments }] = useForm({
id: "purchase-concurrency",
id: "allocate-concurrency",
// TODO: type this
lastSubmission: lastSubmission as any,
onValidate({ formData }) {
Expand Down Expand Up @@ -446,7 +446,9 @@ function Upgradable({
</TableRow>
</TableBody>
</Table>
<FormError id={formEnvironments.id}>{formEnvironments.error}</FormError>
<FormError id={formEnvironments.id}>
{formEnvironments.error ?? formEnvironments.initialError?.[""]?.[0]}
</FormError>
Comment on lines +449 to +451

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Pre-existing: FormError uses field id instead of errorId

At line 449, FormError receives id={formEnvironments.id} rather than id={formEnvironments.errorId}. In conform, errorId is the dedicated ID for error elements (used for aria-describedby accessibility linking), while id is the field input's ID. Using .id means the error element has the same ID as the field input, which is an HTML spec violation (duplicate IDs) and breaks the accessibility association. The same pre-existing pattern exists at line 669 where id={amount.errorId} is correctly used. This inconsistency predates the PR.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

</div>
<Form className="flex flex-col gap-2" method="post" {...form.props} id="allocate">
<input type="hidden" name="action" value="allocate" />
Expand Down Expand Up @@ -664,7 +666,9 @@ function PurchaseConcurrencyModal({
onChange={(e) => setAmountValue(Number(e.target.value))}
disabled={isLoading}
/>
<FormError id={amount.errorId}>{amount.error}</FormError>
<FormError id={amount.errorId}>
{amount.error ?? amount.initialError?.[""]?.[0]}
</FormError>
<FormError>{form.error}</FormError>
</InputGroup>
</Fieldset>
Expand Down