Skip to content

fix(react-tooltip): show tooltip correctly under strict mode - #35282

Merged
Victor Genaev (mainframev) merged 2 commits into
microsoft:masterfrom
mainframev:fix/tooltip-strict-mode-timeout
Oct 7, 2025
Merged

Victor Genaev (mainframev) merged 2 commits into
microsoft:masterfrom
mainframev:fix/tooltip-strict-mode-timeout

Conversation

@mainframev

@mainframev Victor Genaev (mainframev) commented Oct 6, 2025 •

Copy link
Copy Markdown
Contributor

Alternative approach to #34331

Previous Behavior

Tooltip uses a custom utilitiy useTimeout (useBrowserTimer) to manage the timer that delays showing the Tooltip. This utility creates the timer through an imperative function, but clears the timer in a useEffect cleanup function. This results in the tooltip never being shown if it is unmounted and remounted after the Tooltip was triggered but before it was shown. This can happen in StrictMode for a component that receives initial focus when it is created, such as a MenuItem.

New Behavior

Tooltip uses it's inner useTooltipTimeout hook, which is based on previous useTimeout hook from react-utilities implementation with a additional check for a real unmount, making this hook StrictMode aware.

Related Issue(s)

@github-actions

github-actions Bot commented Oct 6, 2025 •

Copy link
Copy Markdown

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-charts
AreaChart
384.836 kB
117.337 kB
385.273 kB
117.451 kB
437 B
114 B
react-charts
DeclarativeChart
681.534 kB
195.71 kB
681.971 kB
195.883 kB
437 B
173 B
react-charts
GanttChart
368.076 kB
110.829 kB
368.513 kB
111.013 kB
437 B
184 B
react-charts
GaugeChart
311.254 kB
92.242 kB
311.697 kB
92.373 kB
443 B
131 B
react-charts
GroupedVerticalBarChart
371.605 kB
111.951 kB
372.042 kB
112.142 kB
437 B
191 B
react-charts
HeatMapChart
370.104 kB
112.45 kB
370.541 kB
112.572 kB
437 B
122 B
react-charts
HorizontalBarChart
295.707 kB
87.014 kB
296.144 kB
87.195 kB
437 B
181 B
react-charts
LineChart
394.341 kB
118.887 kB
394.778 kB
119.037 kB
437 B
150 B
react-charts
ScatterChart
375.861 kB
113.403 kB
376.298 kB
113.59 kB
437 B
187 B
react-charts
VerticalBarChart
410.675 kB
118.927 kB
411.112 kB
119.082 kB
437 B
155 B
react-charts
VerticalStackedBarChart
382.491 kB
114.801 kB
382.928 kB
114.93 kB
437 B
129 B
react-components
react-components: entire library
1.277 MB
320.897 kB
1.278 MB
321.038 kB
437 B
141 B
react-tooltip
Tooltip
57.922 kB
20.084 kB
57.962 kB
20.099 kB
40 B
15 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-avatar
Avatar
48.555 kB
15.528 kB
react-avatar
AvatarGroup
19.235 kB
7.617 kB
react-avatar
AvatarGroupItem
62.699 kB
19.747 kB
react-charts
DonutChart
296.966 kB
88.76 kB
react-charts
FunnelChart
288.205 kB
85.707 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
Legends
235.243 kB
69.602 kB
react-charts
SankeyChart
198.878 kB
61.101 kB
react-charts
Sparkline
91.123 kB
28.692 kB
react-checkbox
Checkbox
34.37 kB
11.792 kB
react-combobox
Combobox (including child components)
106.981 kB
34.816 kB
react-combobox
Dropdown (including child components)
107.611 kB
34.737 kB
react-components
react-components: Button, FluentProvider & webLightTheme
68.796 kB
19.903 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.662 kB
68.579 kB
react-components
react-components: FluentProvider & webLightTheme
43.63 kB
14.257 kB
react-datepicker-compat
DatePicker Compat
226.703 kB
64.124 kB
react-dialog
Dialog (including children components)
103.613 kB
30.917 kB
react-field
Field
22.697 kB
8.603 kB
react-input
Input
27.148 kB
9.108 kB
react-list
List
88.922 kB
26.387 kB
react-list
ListItem
112.422 kB
33.229 kB
react-persona
Persona
55.446 kB
17.41 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-progress
ProgressBar
16.593 kB
6.613 kB
react-radio
Radio
31.8 kB
10.006 kB
react-radio
RadioGroup
14.889 kB
6.09 kB
react-select
Select
26.987 kB
9.848 kB
react-slider
Slider
37.211 kB
12.461 kB
react-spinbutton
SpinButton
34.468 kB
11.453 kB
react-swatch-picker
@fluentui/react-swatch-picker - package
106.082 kB
30.558 kB
react-switch
Switch
34.55 kB
11.013 kB
react-table
DataGrid
161.157 kB
45.558 kB
react-table
Table (Primitives only)
41.975 kB
13.575 kB
react-table
Table as DataGrid
131.48 kB
36.345 kB
react-table
Table (Selection only)
69.843 kB
19.71 kB
react-table
Table (Sort only)
68.486 kB
19.324 kB
react-tag-picker
@fluentui/react-tag-picker - package
188.376 kB
56.482 kB
react-tags
InteractionTag
14.561 kB
5.865 kB
react-tags
Tag
30.413 kB
9.802 kB
react-tags
TagGroup
83.125 kB
24.561 kB
react-textarea
Textarea
25.53 kB
9.361 kB
react-timepicker-compat
TimePicker
109.972 kB
36.348 kB
react-tree
FlatTree
149.042 kB
42.637 kB
react-tree
PersonaFlatTree
149.798 kB
42.771 kB
react-tree
PersonaTree
146.063 kB
41.633 kB
react-tree
Tree
145.313 kB
41.507 kB
🤖 This report was generated against 3a3e9a5db8239273f4afe337359e72e569d99f05

@github-actions

github-actions Bot commented Oct 6, 2025

Copy link
Copy Markdown

Pull request demo site: URL

@mainframev
Victor Genaev (mainframev) force-pushed the fix/tooltip-strict-mode-timeout branch from 573260d to b13e106 Compare October 6, 2025 11:32
@mainframev
Victor Genaev (mainframev) marked this pull request as ready for review October 7, 2025 10:28
@Hotell

Copy link
Copy Markdown
Contributor

test-rit type-check is failing because we don't ignore cypress from type-check

  • update apps/rit-tests-v9/tsconfig.lib.json
"exclude": [
+    "**/*.cy.ts",
+    "**/*.cy.tsx"
  ],

@Hotell

Copy link
Copy Markdown
Contributor

test-rit type-check is failing because we don't ignore cypress from type-check

  • update apps/rit-tests-v9/tsconfig.lib.json
"exclude": [
+    "**/*.cy.ts",
+    "**/*.cy.tsx"
  ],

#35293

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]: Tooltips of MenuItem is not showing when open menu button by keyboard

2 participants