Repository navigation
[all components] Fix stale focused field state - #5345
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,292.28 ms +66.83 ms(+5.5%) | Renders: 76 (+0) | Paint: 2,139.90 ms +108.21 ms(+5.3%)
14 tests within noise — details Metric alarms
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. |
4354b0e to
69c0549
Compare
69c0549 to
c9cc2a5
Compare
dfecc6b to
024457e
Compare
|
@claude review |
|
review: PR reviewNothing here is merge-blocking: the two mechanisms (last-attach-wins Bugs (4)1. 🟠
|
0f7cd42 to
127d36b
Compare
DX reviewThe focus-ownership fix is sound overall, but disabled radios can still reacquire the field’s focused state. Findings (1)1. 🟠 Disabled radios can reacquire
|
3a258aa to
1fccf43
Compare
Fixes #3987
Disabling or unmounting a focused control can move focus away without firing
blur, leavingdata-focusedstuck onField.Root, its label, and the control. This is reproducible in Chromium for both native inputs and buttons.useSetFieldFocusedrecords which focus target owns the field state and releases it when that target becomes disabled or unmounts. Ownership prevents cleanup from an old target from clearing focus that has moved to another target, which is required for components with multiple inherent focus targets such as Slider, Radio Group, and OTP Field.The cleanup is attached to every field-aware focus target:
Field.Control,Switch.Root,Checkbox.Root,NumberField.Input,Radio.Root,OTPField.Input,Slider.Thumb,Select.Trigger, and bothCombobox.InputandCombobox.Trigger.The PR intentionally stays focused on this lifecycle bug. Filled-state remount handling is already covered on
master, and uncommon compositions with multiple independent controls under oneField.Rootare left unsupported rather than adding runtime coordination.