[select] Fix the root id being ignored inside a Field - #5461
Merged
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,010.40 ms ▼-391.99 ms(-28.0%) | Renders: 76 (+0) | Paint: 1,586.56 ms ▼-615.44 ms(-27.9%)
…and 3 more (+7 within noise) — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
atomiks
force-pushed
the
atomiks/select-field-root-id
branch
from
August 10, 2026 13:41
61ad324 to
a79e436
Compare
atomiks
marked this pull request as ready for review
August 10, 2026 13:49
atomiks
requested review from
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
August 10, 2026 13:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An
idonSelect.Rootis dropped when the Select sits inside aField.Root. The trigger renders a generated id instead, so#my-idmatches nothing andField.Labelpoints at the generated id. Outside a Field it works.Select.TriggerregisteredidProp ?? rootIdwith the labelable provider, androotIdis the provider's own selected id read back through the Select store. The provider keeps its current selection while that id is still registered, so the generated id kept re-electing itself and the root'sidcould never take over. The trigger now registers only its own explicitid, which leaves the root as the sole registrant when the trigger has none.Carved out of #5448, which fixed this through a
preferIdargument onregisterControlId. That argument is not needed for this case.#5448's notes also describe an exception in the unregister flush for
Select.Trigger, because it registered an id adopted from the provider one commit behind. That registration no longer exists, so the exception may no longer be needed.Still unfixed, and out of scope here: an explicit
idonSelect.Triggerdoes not move the label when it changes at runtime, and the equivalent Combobox cases are untouched.