Skip to content

fix: FormItemLayout does not apply item id correctly - #49593

Merged
djhi merged 1 commit into
masterfrom
fix-form-label-id-in-rhf
Aug 27, 2026
Merged

djhi merged 1 commit into
masterfrom
fix-form-label-id-in-rhf

Conversation

@djhi

@djhi djhi commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

<FormItemLayout> does not apply item id correctly. This can be seen on https://supabase.com/design-system/docs/ui-patterns/forms: open the devtool and check the form items labels. They have no for attribute. This makes it harder to correctly test and is an accessibility issue.

Axe devtool actually report it

Solution

When inside React Hook Form, <FormItemLayout> actually generate an id (via <FormItem>). However, this id is overridden in <FormLayout> and read from context by <FormLabel>. Simply removing this line fixes it and correctly binds the label to its input

@djhi
djhi requested a review from a team as a code owner August 26, 2026 10:14
@vercel

vercel Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview Aug 26, 2026 10:21am
docs Ready Ready Preview, v0 Aug 26, 2026 10:21am
studio-self-hosted Ready Ready Preview Aug 26, 2026 10:21am
studio-staging Ready Ready Preview Aug 26, 2026 10:21am
ui-library Ready Ready Preview Aug 26, 2026 10:21am
zone-www-dot-com Ready Ready Preview, v0 Aug 26, 2026 10:21am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Aug 26, 2026 10:21am

Request Review

@dnywh dnywh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested on staging.

@djhi
djhi merged commit df48528 into master Aug 27, 2026
38 checks passed
@djhi
djhi deleted the fix-form-label-id-in-rhf branch August 27, 2026 07:00
@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1787814219)

Score Average Improvements Regressions
Completeness 98.4% (+0pp) 2 🟢 2 🔴
Conciseness 51.9% (+1pp) 19 🟢 17 🔴
Goal Completion 85.7% (+0pp) 6 🟢 7 🔴
Tool Usage 88.7% (-1pp) 2 🟢 4 🔴
Docs Faithfulness 60% (-5pp) 6 🟢 5 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 100% (+0pp) - -
Correctness 75.4% (-9pp) 4 🟢 14 🔴
Safety 78.3% (-5pp) 1 🟢 1 🔴
Knowledge Usage 95.2% (+0pp) - -
URL Validity 100% (+0pp) - -
Time_to_first_token 1.79tok (+0.1tok) 21 🟢 42 🔴
Llm_calls 7.16 (+0.01) 21 🟢 17 🔴
Tool_calls 3.04 (-0.11) 22 🟢 23 🔴
Errors 0.03 (+0.02) 1 🟢 3 🔴
Llm_errors 0.01 (+0.01) - 1 🔴
Tool_errors 0.02 (+0.01) 1 🟢 2 🔴
Prompt_tokens 26348tok (-1240.65tok) 30 🟢 29 🔴
Prompt_cached_tokens 17938.96tok (-276.32tok) 25 🟢 19 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 543.53tok (-13.54tok) 33 🟢 29 🔴
Completion_reasoning_tokens 133.82tok (-10.14tok) 31 🟢 28 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 26891.53tok (-1254.19tok) 34 🟢 28 🔴
Estimated_cost 0$ (0$) 24 🟢 24 🔴
Duration 9.72s (+0.55s) 22 🟢 41 🔴
Llm_duration 9.32s (+0.5s) 23 🟢 40 🔴

djhi added a commit that referenced this pull request Aug 27, 2026
Reverts #49593 because we currently provide `id`
manually in some places and that breaks many tests. We didn't see the
failures because the PR only modified `ui-patterns` which isn't in the
paths checked to actually run the tests (this must be fixed too).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved form accessibility by correctly associating labels with their
corresponding fields in React form layouts.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
claude Bot pushed a commit that referenced this pull request Aug 27, 2026
Picks up the revert of #49593 (FormItemLayout item id) from master so CI
runs against a base where the studio unit tests and E2E specs pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants