Skip to content

fix(react-button): do not expose default menuIcon in useMenuButtonBase_unstable#36345

Open
mainframev wants to merge 2 commits into
microsoft:masterfrom
mainframev:fix/menu-button-base-default-icon
Open

fix(react-button): do not expose default menuIcon in useMenuButtonBase_unstable#36345
mainframev wants to merge 2 commits into
microsoft:masterfrom
mainframev:fix/menu-button-base-default-icon

Conversation

@mainframev

@mainframev mainframev commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Addresses review comment: #36320 (comment)

…e_unstable

Move the default ChevronDownRegular icon out of the headless base hook
(useMenuButtonBase_unstable) and into the styled useMenuButton_unstable so
that headless consumers do not inherit a default icon. The default is applied
in a null-safe way so that menuIcon={null} still hides the icon.

Add regression tests covering menuIcon={null} on the styled hook and the
absence of a default icon on the base hook.
@mainframev mainframev requested a review from a team as a code owner June 24, 2026 16:18
@github-actions

Copy link
Copy Markdown

Pull request demo site: URL

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-button
MenuButton
37.588 kB
9.892 kB
37.615 kB
9.91 kB
27 B
18 B
react-button
SplitButton
46.556 kB
11.533 kB
46.584 kB
11.551 kB
28 B
18 B
react-charts
AreaChart
404.498 kB
126.128 kB
404.526 kB
126.136 kB
28 B
8 B
react-charts
DeclarativeChart
755.499 kB
220.495 kB
755.527 kB
220.52 kB
28 B
25 B
react-charts
DonutChart
314.961 kB
96.878 kB
314.989 kB
96.884 kB
28 B
6 B
react-charts
FunnelChart
306.46 kB
93.69 kB
306.488 kB
93.707 kB
28 B
17 B
react-charts
GanttChart
387.595 kB
120.492 kB
387.622 kB
120.513 kB
27 B
21 B
react-charts
GaugeChart
314.339 kB
96.25 kB
314.367 kB
96.27 kB
28 B
20 B
react-charts
GroupedVerticalBarChart
395.467 kB
123.213 kB
395.495 kB
123.234 kB
28 B
21 B
react-charts
HeatMapChart
389.674 kB
121.531 kB
389.702 kB
121.546 kB
28 B
15 B
react-charts
HorizontalBarChart
294.633 kB
89.357 kB
294.661 kB
89.371 kB
28 B
14 B
react-charts
Legends
234.31 kB
70.189 kB
234.338 kB
70.187 kB
28 B
-2 B
react-charts
LineChart
415.826 kB
129.097 kB
415.854 kB
129.142 kB
28 B
45 B
react-charts
PolarChart
343.31 kB
106.743 kB
343.338 kB
106.751 kB
28 B
8 B
react-charts
ScatterChart
395.209 kB
123.217 kB
395.237 kB
123.235 kB
28 B
18 B
react-charts
VerticalBarChart
431.947 kB
128.17 kB
431.975 kB
128.182 kB
28 B
12 B
react-charts
VerticalStackedBarChart
401.671 kB
124.635 kB
401.699 kB
124.665 kB
28 B
30 B
react-components
react-components: entire library
1.296 MB
325.606 kB
1.296 MB
325.645 kB
35 B
39 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-breadcrumb
@fluentui/react-breadcrumb - package
102.926 kB
28.76 kB
react-button
Button
32.684 kB
8.504 kB
react-button
CompoundButton
39.562 kB
9.861 kB
react-button
ToggleButton
52.344 kB
10.635 kB
react-card
Card - All
93.06 kB
26.955 kB
react-card
Card
85.658 kB
25.044 kB
react-card
CardFooter
11.516 kB
4.606 kB
react-card
CardHeader
14.047 kB
5.435 kB
react-card
CardPreview
11.597 kB
4.716 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
SankeyChart
211.914 kB
67.836 kB
react-charts
Sparkline
80.503 kB
26.644 kB
react-components
react-components: Button, FluentProvider & webLightTheme
66.328 kB
19.02 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
226.531 kB
68.074 kB
react-components
react-components: FluentProvider & webLightTheme
39.525 kB
13.113 kB
react-dialog
Dialog (including children components)
90.204 kB
27.895 kB
react-headless-components-preview
react-headless-components-preview: entire library
248.544 kB
71.466 kB
react-message-bar
MessageBar (all components)
22.306 kB
8.184 kB
react-portal-compat
PortalCompatProvider
5.567 kB
2.237 kB
react-tag-picker
@fluentui/react-tag-picker - package
174.152 kB
54.127 kB
react-teaching-popover
TeachingPopover
101.1 kB
31.859 kB
react-timepicker-compat
TimePicker
141.076 kB
46.036 kB
react-tree
FlatTree
135.901 kB
40.452 kB
react-tree
PersonaFlatTree
137.729 kB
40.967 kB
react-tree
PersonaTree
133.79 kB
39.741 kB
react-tree
Tree
131.968 kB
39.256 kB
🤖 This report was generated against 19d82d85bda458b0af3fa4e0814bf3232fc78594

mainframev added a commit to mainframev/fluentui that referenced this pull request Jun 24, 2026
…on_unstable

Align with the standalone react-button PR (microsoft#36345). Replaces the post-hoc
mutation of baseState.menuIcon with passing a null-safe default into
useMenuButtonBase_unstable, so menuIcon={null} still hides the icon.

This react-button change is owned by microsoft#36345 and will drop out of this
branch once microsoft#36345 merges and this branch is rebased onto master.
@@ -0,0 +1,7 @@
{

@github-actions github-actions Bot Jun 24, 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/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 617 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 515 Changed
vr-tests-react-components/ProgressBar converged 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 58 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png 51 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 80 Changed
vr-tests-react-components/TagPicker 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - High Contrast.chromium.png 1319 Changed
vr-tests-react-components/TagPicker.disabled.disabled input hover.chromium.png 677 Changed

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

@mainframev mainframev force-pushed the fix/menu-button-base-default-icon branch from 7b39038 to bde5af0 Compare June 24, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant