fix(react-combobox): expand/collapse when clicking in root padding area#36013
fix(react-combobox): expand/collapse when clicking in root padding area#36013
Conversation
Agent-Logs-Url: https://github.com/microsoft/fluentui/sessions/2a17f5f4-bf80-4529-9fe1-c95454fd3706 Co-authored-by: tudorpopams <97875118+tudorpopams@users.noreply.github.com>
…clarity Agent-Logs-Url: https://github.com/microsoft/fluentui/sessions/2a17f5f4-bf80-4529-9fe1-c95454fd3706 Co-authored-by: tudorpopams <97875118+tudorpopams@users.noreply.github.com>
|
@copilot rebase this branch against master |
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: tudorpopams <97875118+tudorpopams@users.noreply.github.com>
Co-authored-by: tudorpopams <97875118+tudorpopams@users.noreply.github.com>
|
@copilot not sure why this branch now has message bar changes in it. Please make sure you update with the latest changes from master. |
The net file diff of this branch vs What's happening is that the branch's commit history contains an extra commit with the same title as master's I locally reset the branch onto the current |
📊 Bundle size reportUnchanged fixtures
|
|
Pull request demo site: URL |
| /* handle open/close + focus when clicking in the root's padding area (dead zone to the right of expand/clear icon) */ | ||
| const { onMouseDown: onRootMouseDown } = state.root; | ||
|
|
||
| const onRootDirectMouseDown = useEventCallback( |
There was a problem hiding this comment.
There was a problem hiding this comment.
Switched to the CSS pseudo-element approach in 6cf6a84. Added position: relative + an ::after on the base .icon class, with size-variant rules that set right: calc(-1 * <paddingRight>) so the pseudo extends exactly into the root's right padding (SNudge/MNudge/M for small/medium/large). This works for both expandIcon and clearIcon (they share the icon style), and RTL is handled automatically since right flips under dir="rtl". Removed the JS root mouseDown handler and its unit test. All 252 react-combobox tests still pass.
…d of root mouseDown handler Agent-Logs-Url: https://github.com/microsoft/fluentui/sessions/ee168fd3-8e16-4bbc-9857-adba103fc896 Co-authored-by: tudorpopams <97875118+tudorpopams@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| @@ -0,0 +1,7 @@ | |||
| { | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/Charts-DonutChart 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Charts-DonutChart.Dynamic - RTL.default.chromium.png | 5570 | 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 - RTL.submenus open.chromium.png | 404 | Changed |
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png | 413 | Changed |
vr-tests-react-components/Positioning 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Positioning.Positioning end.chromium.png | 905 | Changed |
| vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 625 | Changed |
vr-tests-react-components/ProgressBar converged 3 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png | 137 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png | 83 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png | 133 | Changed |
vr-tests-react-components/TagPicker 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/TagPicker.disabled - RTL.disabled input hover.chromium.png | 635 | Changed |
There were 1 duplicate changes discarded. Check the build logs for more information.


The Combobox would not expand when clicking in the right padding area between the chevron icon and the component's right border.
Root cause
The root
divusesdisplay: inline-gridwithgridTemplateColumns: '1fr auto'and a size-variantpaddingRight. No child element occupies that padding space, so clicks there target the rootdivdirectly — which has no open/close handler.The
Dropdowncomponent doesn't have this issue because its trigger is a<button>that owns the padding internally.Fix
Extended the clickable area of the trailing icon (
expandIcon/clearIcon) into the root's right paddingRight dead zone using a CSS::afterpseudo-element on the sharediconstyle inuseComboboxStyles.styles.ts:Because the pseudo-element is a descendant of the icon, hits in the extended area are attributed to the icon and trigger its existing
onMouseDownhandler. Usingright(instead of a JS handler) means RTL is handled automatically by the browser. The same rule benefitsclearIconsince both slots share theiconstyle.The earlier JS-based approach (an
onMouseDownhandler on the root slot guarded byevent.target === event.currentTarget) and its unit test were removed in favor of this styles-only solution per PR review feedback.