-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
Provide a general summary of the issue here
When multiple tooltips are open controlled, the first tooltip would not close after the cursor hovers on the second tooltip.
🤔 Expected Behavior?
The first tooltip would close after the cursor hovers on the second tooltip.
😯 Current Behavior
Screen.Recording.2024-04-19.at.11.00.10.AM.mov
💁 Possible Solution
- It seems the
closeOpenTooltipsfunction inpackages/@react-stately/tooltip/src/useTooltipTriggerState.tsis not working properly when theisOpenprop is controlled, when the close handler is called, the currentValue(open) inuseControlledStateis still false thus not trigger theonOpenChangehandler in the Tooltip.
let closeOpenTooltips = () => {
for (let hideTooltipId in tooltips) {
if (hideTooltipId !== id) {
tooltips[hideTooltipId](true);
delete tooltips[hideTooltipId];
}
}
};
🔦 Context
No response
🖥️ Steps to Reproduce
- The story in the react-spectrum repo can reproduce this issue: http://localhost:9003/?path=/story/tooltiptrigger--controlled-multiple-tooltips&providerSwitcher-express=false&strict=true
Version
3.32.1
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
MacOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
ryanelian, Niznikr and igorman007