base-ui
base-ui copied to clipboard
[field] Forward `controlId` from `FieldRoot`
Fixes https://github.com/mui/base-ui/pull/2154#issuecomment-2999545029
Links the labels to ids sooner to avoid browser errors, currently in Chrome there are blue warnings on the labels of Input, Select and NumberField as well
- [x] I have followed (at least) the PR section of the contributing guide.
Bundle size report
| Bundle | Parsed Size | Gzip Size |
|---|---|---|
| @base-ui-components/react | 🔺+210B(+0.07%) | 🔺+114B(+0.12%) |
Generated by :no_entry_sign: dangerJS against ba9b3186e20cda1d69444c083e6af9db2617b6be
Deploy Preview for base-ui ready!
| Name | Link |
|---|---|
| Latest commit | ba9b3186e20cda1d69444c083e6af9db2617b6be |
| Latest deploy log | https://app.netlify.com/projects/base-ui/deploys/685bdeb417cab80008226a6a |
| Deploy Preview | https://deploy-preview-2158--base-ui.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Initializing controlId from Field breaks the implicitly linked controls like radio/switch/checkbox since the default id is rendered until it's unset on mount and causes the same red warning:
Deferring the label's htmlFor to a state causes blue warnings for explicitly linked controls (e.g. Input):