Skip to content

Conversation

@dmytrokirpa
Copy link
Contributor

@dmytrokirpa dmytrokirpa commented Nov 24, 2025

Previous Behavior

Button's active state is only visible when mouse is hovering a button (introduced in #22574)

Demo - active state is not visible when button is focused and a user presses space:

Screen.Recording.2025-11-25.at.9.59.29.mov

New Behavior

Button's active state is visible when mouse is hovering a button or when the button has :focus-visible. This allows us to show active state on keyboard press without breaking the behavior introduced #22574

Demo - active state is visible when mouse is hovering a button or when a user presses "space" on focused button

Screen.Recording.2025-11-25.at.9.58.38.mov

Related Issue(s)

@github-actions
Copy link

github-actions bot commented Nov 24, 2025

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-breadcrumb
@fluentui/react-breadcrumb - package
114.136 kB
31.456 kB
115.625 kB
31.709 kB
1.489 kB
253 B
react-button
Button
36.611 kB
10.409 kB
38.098 kB
10.605 kB
1.487 kB
196 B
react-button
CompoundButton
43.012 kB
11.71 kB
44.982 kB
11.967 kB
1.97 kB
257 B
react-button
MenuButton
41.551 kB
11.818 kB
43.038 kB
12.045 kB
1.487 kB
227 B
react-button
SplitButton
49.613 kB
13.391 kB
51.803 kB
13.67 kB
2.19 kB
279 B
react-button
ToggleButton
52.549 kB
12.196 kB
55.016 kB
12.439 kB
2.467 kB
243 B
react-charts
AreaChart
401.451 kB
122.847 kB
402.94 kB
123.065 kB
1.489 kB
218 B
react-charts
DeclarativeChart
719.14 kB
208.19 kB
720.629 kB
208.392 kB
1.489 kB
202 B
react-charts
DonutChart
297.339 kB
88.898 kB
298.828 kB
89.101 kB
1.489 kB
203 B
react-charts
FunnelChart
288.594 kB
85.727 kB
290.083 kB
85.929 kB
1.489 kB
202 B
react-charts
GanttChart
383.208 kB
116.015 kB
384.697 kB
116.219 kB
1.489 kB
204 B
react-charts
GaugeChart
312.216 kB
92.539 kB
313.705 kB
92.734 kB
1.489 kB
195 B
react-charts
GroupedVerticalBarChart
391.23 kB
118.639 kB
392.719 kB
118.848 kB
1.489 kB
209 B
react-charts
HeatMapChart
385.288 kB
117.724 kB
386.777 kB
117.935 kB
1.489 kB
211 B
react-charts
HorizontalBarChart
294.96 kB
86.77 kB
296.449 kB
87.009 kB
1.489 kB
239 B
react-charts
Legends
234.066 kB
69.154 kB
235.555 kB
69.356 kB
1.489 kB
202 B
react-charts
LineChart
410.739 kB
124.283 kB
412.228 kB
124.497 kB
1.489 kB
214 B
react-charts
ScatterChart
390.63 kB
118.543 kB
392.119 kB
118.753 kB
1.489 kB
210 B
react-charts
VerticalBarChart
425.562 kB
123.604 kB
427.051 kB
123.837 kB
1.489 kB
233 B
react-charts
VerticalStackedBarChart
397.459 kB
119.543 kB
398.948 kB
119.78 kB
1.489 kB
237 B
react-components
react-components: Button, FluentProvider & webLightTheme
68.702 kB
19.799 kB
70.189 kB
20.037 kB
1.487 kB
238 B
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
235.705 kB
68.293 kB
237.194 kB
68.545 kB
1.489 kB
252 B
react-components
react-components: entire library
1.278 MB
320.665 kB
1.282 MB
321.219 kB
3.651 kB
554 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-card
Card - All
105.924 kB
29.733 kB
react-card
Card
98.592 kB
27.856 kB
react-card
CardFooter
13.549 kB
5.411 kB
react-card
CardHeader
16.082 kB
6.279 kB
react-card
CardPreview
13.633 kB
5.547 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
SankeyChart
199.518 kB
61.371 kB
react-charts
Sparkline
91.385 kB
28.704 kB
react-components
react-components: FluentProvider & webLightTheme
43.528 kB
14.148 kB
react-dialog
Dialog (including children components)
102.738 kB
30.646 kB
react-message-bar
MessageBar (all components)
24.057 kB
8.884 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-tag-picker
@fluentui/react-tag-picker - package
187.327 kB
56.145 kB
react-teaching-popover
TeachingPopover
101.867 kB
30.488 kB
react-timepicker-compat
TimePicker
108.943 kB
35.995 kB
react-tree
FlatTree
148.292 kB
42.393 kB
react-tree
PersonaFlatTree
150.12 kB
42.772 kB
react-tree
PersonaTree
146.181 kB
41.588 kB
react-tree
Tree
144.361 kB
41.232 kB
🤖 This report was generated against 9e7bcb7703285ebe33f032d7be9dd09e45787dfb

@github-actions
Copy link

Pull request demo site: URL

@dmytrokirpa dmytrokirpa marked this pull request as ready for review November 25, 2025 09:02
@dmytrokirpa dmytrokirpa requested review from a team and marcosmoura as code owners November 25, 2025 09:02
},

':hover:active': {
':hover:active,:active:focus-visible': {
Copy link
Contributor

Choose a reason for hiding this comment

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

pls use Fluent UI focus indicator

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@dmytrokirpa dmytrokirpa Nov 25, 2025

Choose a reason for hiding this comment

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

I'm not totally sure that's feasible here, since I'd have to duplicate all the :active styles - unless I'm overlooking something? Also, I don't actually need the focus outline styles here, just want to fix this edge case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jurokapsiar, could you clarify why you think we should use the focus indicator style hooks here? Just so we're on the same page, this update isn’t about styling the focus state - it’s just for applying the :active state to the button, either when the clicks on the button and the pointer’s over it (introduced in #22574) or when a user presses space/enter while the button’s focused (this PR).

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.

[Bug]: Triggering button's active state with the spacebar is only visible when mouse is hovering

3 participants