Skip to content

fix(react-tag-picker): drop no-op supportsSize field control option - #36468

Draft
Hotell wants to merge 4 commits into
microsoft:masterfrom
Hotell:fix/tagpicker-field-supports-size
Draft

fix(react-tag-picker): drop no-op supportsSize field control option#36468
Hotell wants to merge 4 commits into
microsoft:masterfrom
Hotell:fix/tagpicker-field-supports-size

Conversation

@Hotell

@Hotell Hotell commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

Follow-up cleanup discovered while reviewing #36453.

useFieldControlProps_unstable(props, { supportsSize: true }) sets size on the props it returns, so it only has an effect if the control reads size from that returned object.

TagPickerInput never did — removed

  • TagPickerInputProps explicitly omits size, and TagPickerInputBaseState omits it too.
  • The rendered size comes from TagPickerContext, on a different scale ('medium' | 'large' | 'extra-large') than Field's 'small' | 'medium' | 'large'.
  • So the injected value was only ever forwarded to the native <input> (size is in inputProperties), where React discards it as an invalid numeric attribute.

Verified by rendering useTagPickerInput_unstable inside <Field size="small">:

state.root.size => "small"   // leaked to the native <input>, dropped by React
state.size      => "medium"  // actual styling size, from TagPickerContext

No user-visible symptom — purely dead config. Removed, with a note explaining why it must not be re-added.

Input / TextareaTODO only

The base-hook split moved the size destructuring into the styled hook, so the injected size is stripped before the base hook ever runs. Left in place here with a TODO; the actual removal and the real fix (reading useFieldContext_unstable()?.size in the styled hook) land in #36453 — this PR deliberately does not touch that to avoid conflicting.

supportsSize is documented, not deprecated

An earlier revision of this PR marked the option @deprecated. That was walked back: the option is not broken, it does exactly what it documents, and it remains the most ergonomic choice for any control that reads size off the returned props. The no-op only arises from Fluent's own base-hook/styled-hook split — an implementation detail we should not push onto external consumers via deprecation warnings.

Instead the JSDoc now spells out the constraint, so the failure mode is discoverable at the call site.

Note

Draft until #36453 merges. After that, the two TODOs (and their supportsSize: true call sites) should be removed.

Verification

  • nx run-many -t lint test type-check -p react-field react-tag-picker react-input react-textarea — all green (280 tests)
  • yarn beachball check — OK
  • nx run react-field:generate-api — no api.md delta (API Extractor does not emit member JSDoc for type aliases)

`useFieldControlProps_unstable({ supportsSize: true })` injects the Field size
into the control props. That only works if the control reads `size` from the
same props object it passes to the hook.

- `TagPickerInput` never did: it has no `size` prop and derives its size from
  `TagPickerContext`, on a different scale (`medium | large | extra-large`).
  The injected value only reached the native `<input>`, where React drops it
  as an invalid numeric attribute. Removed.
- `Input`/`Textarea` no longer do either, since the base-hook split moved the
  `size` destructuring into the styled hook. Flagged with a TODO; the actual
  removal + fix lands in microsoft#36453.

The option is deprecated in favour of reading the size in the styled hook via
`useFieldContext_unstable()`.
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.295 MB
326.281 kB
1.295 MB
326.278 kB
-16 B
-3 B
react-tag-picker
@fluentui/react-tag-picker - package
174.01 kB
54.191 kB
173.994 kB
54.187 kB
-16 B
-4 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-checkbox
Checkbox
29.609 kB
10.527 kB
react-combobox
Combobox (including child components)
138.149 kB
44.681 kB
react-combobox
Dropdown (including child components)
137.905 kB
44.453 kB
react-components
react-components: Button, FluentProvider & webLightTheme
66.281 kB
19.002 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
226.026 kB
68.049 kB
react-components
react-components: FluentProvider & webLightTheme
39.504 kB
13.112 kB
react-datepicker-compat
DatePicker Compat
216.224 kB
63.964 kB
react-field
Field
21.132 kB
7.881 kB
react-headless-components-preview
react-headless-components-preview: entire library
251.914 kB
72.891 kB
react-input
Input
25.027 kB
8.183 kB
react-list
List
74.531 kB
23.01 kB
react-list
ListItem
98.023 kB
29.881 kB
react-portal-compat
PortalCompatProvider
5.341 kB
2.146 kB
react-progress
ProgressBar
19.063 kB
7.418 kB
react-radio
Radio
26.994 kB
8.711 kB
react-radio
RadioGroup
12.759 kB
5.176 kB
react-select
Select
24.876 kB
8.936 kB
react-slider
Slider
32.231 kB
11.086 kB
react-spinbutton
SpinButton
32.513 kB
10.584 kB
react-swatch-picker
@fluentui/react-swatch-picker - package
92.187 kB
27.315 kB
react-switch
Switch
32.231 kB
10.156 kB
react-table
DataGrid
146.759 kB
43.576 kB
react-table
Table (Primitives only)
36.893 kB
12.305 kB
react-table
Table as DataGrid
118.503 kB
33.331 kB
react-table
Table (Selection only)
65.373 kB
18.591 kB
react-table
Table (Sort only)
64.036 kB
18.204 kB
react-textarea
Textarea
23.392 kB
8.447 kB
react-timepicker-compat
TimePicker
140.867 kB
46.058 kB
react-tree
FlatTree
135.661 kB
40.459 kB
react-tree
PersonaFlatTree
137.524 kB
40.991 kB
react-tree
PersonaTree
133.605 kB
39.781 kB
react-tree
Tree
131.748 kB
39.265 kB
🤖 This report was generated against 5726a85e58837117b2bb82441a4624bccf119dd7

@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@Hotell Hotell changed the title chore(react-field): deprecate supportsSize and drop its no-op TagPicker usage fix(react-tag-picker): drop no-op supportsSize field control option Jul 31, 2026
@@ -0,0 +1,7 @@
{

@github-actions github-actions Bot Jul 31, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Menu 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu.Nested Submenus Small Viewport Flipped.nested menu.chromium.png 695 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png 413 Changed
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 492 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 513 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 110 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 81 Changed
vr-tests-react-components/TagPicker 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - High Contrast.disabled input hover.chromium.png 1319 Changed
vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png 658 Changed

There were 2 duplicate changes discarded. Check the build logs for more information.

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.

1 participant