fix(react-input, react-textarea): Fix Field control size handling#36453
fix(react-input, react-textarea): Fix Field control size handling#36453dmytrokirpa wants to merge 1 commit into
Conversation
…Input and Textarea
📊 Bundle size reportUnchanged fixtures
|
|
Pull request demo site: URL |
| @@ -0,0 +1,7 @@ | |||
| { | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/CalendarCompat 4 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/CalendarCompat.multiDayView.default.chromium_1.png | 478 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView - High Contrast.default.chromium.png | 1202 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView - RTL.default.chromium.png | 479 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView - Dark Mode.default.chromium.png | 1096 | Changed |
vr-tests-react-components/Field 5 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Field.Input+horizontal.default.chromium.png | 5610 | Changed |
| vr-tests-react-components/Field.Textarea+horizontal.default.chromium.png | 2696 | Changed |
| vr-tests-react-components/Field.Textarea.default.chromium.png | 3543 | Changed |
| vr-tests-react-components/Field.size-large.default.chromium.png | 3841 | Changed |
| vr-tests-react-components/Field.size-small.default.chromium.png | 3841 | Changed |
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png | 404 | Changed |
vr-tests-react-components/Positioning 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Positioning.Positioning end.chromium.png | 897 | Changed |
| vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 44 | Changed |
vr-tests-react-components/ProgressBar converged 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png | 34 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png | 43 | Changed |
There were 1 duplicate changes discarded. Check the build logs for more information.
| }); | ||
|
|
||
| expect(result.current.input.value).toBe('test'); | ||
| expect(result.current.size).toBe('large'); |
There was a problem hiding this comment.
q: is this expected behaviour in terms of design language consistency ? user can go wild and use various sizes between field/input ?
There was a problem hiding this comment.
From a design language point of view, I’m not sure this is behaving as expected. In the all controls implementation, context values act as defaults, and component props override them.
| const fieldControlProps = useFieldControlProps_unstable(props, { | ||
| supportsLabelFor: true, | ||
| supportsRequired: true, | ||
| supportsSize: true, |
There was a problem hiding this comment.
with these changes is this prop dead API now ? it is still used in TagPickerInput, should we reflect these changes there as well ?
There was a problem hiding this comment.
it's not a dead API, it just doesn't make sense for base hooks as they shouldn't have style props (size/appearance/etc)
There was a problem hiding this comment.
I'll double check for TagPicker and other components

Fixes Field control size handling for Input and Textarea components
Changes
Packages affected
Beachball change files have been created for both packages.
Before (all inputs doesn't respect field size)
After (inputs respect field size)