Tooltip reappears without hover after tab switch
Environment Information
- Package version(s): 6.164.8/office-ui-fabric-react.min.js
- Browser and OS versions: Microsoft Edge (Chromium) Version 84.0.516.1 (Official build) Dev (64-bit)
Please provide a reproduction of the bug in a codepen:
- Click on [Hover over me] button on Fluent UI docs. Button gains focus but tooltip dismisses when mouse is moved away.
- Click to switch to another tab
- Click to switch back to docs tab

Actual behavior:
Tooltip appears without mouse hover.
Expected behavior:
Tooltip should not appear.
@joshjcarrier Thanks for GIF! Super helpful! We'll take a look at this.
This happens because TooltipHost defines onFocusCapture, which is invoked whenever an element is gains focus. As clicking causes the button to retain focus, this explains the tooltip reappearing when the page is brought back into view.
A possible workaround would be to forcefully defocus the button when the page itself loses focus, though that would likely need to be done app-side as we probably don't want that logic in the tooltip itself.
@micahgodbolt - any other thoughts?
Hi @jdhuntington - I'm not sure it's reasonable to say that this is By design. The fact that this behavior can be explained in terms of the current implementation doesn't mean that this is the desired behavior.
forcefully defocus the button when the page itself loses focus
Hard no on this option, that would introduce major accessibility issues.
My take on this is that expected behavior is that the tooltip appears only when focus initially moves into that element while on the same page. As keyboard user, I don't expect switching tabs to be considered equivalent to tabbing into that element.
@BrendanMcK do you know if it's possible for the browser to differentiate a tab to focus vs 'browser tab' to focus? If we can test and identify the source, then we can certainly look at changing it.
One of our focus utilities needed to ignore blur events due to tabs becoming inactive - we only want real blurs. In that specific case, the tell was that despite the element getting a blur, it was still returned as document.activeElement. Not sure if that would work here, or if it can be used to do similar to determine whether a focus is a real focus or a 'restore' focus.
Looks like visibilitychange determines if the tab gained/lost focus.
Alternatively, could onFocusCapture determine the source like react-northstar/Tooltip?
@joshjcarrier haven't dug into it too much, but is your suggestion something we can do at the control level, or is this an app level change? If it's at the control level I can open the issue back up.
I believe TooltipHost can handle it on its onFocusCapture handler.
Because this issue is marked as by design and has not had activity for over 3 days, we're automatically closing it for house-keeping purposes.
@micahgodbolt did we intend for the bot to close this?
The 'by design' tag told the bot to close it. I removed the tag.
is there a workaround for this?
I am seeing this as well. Is there a fix or workaround for this one ?
:tada:This issue was addressed in #18884, which has now been successfully released as @fluentui/[email protected].:tada:
Handy links:
:tada:This issue was addressed in #18884, which has now been successfully released as @fluentui/[email protected].:tada:
Handy links:
:tada:This issue was addressed in #18884, which has now been successfully released as @fluentui/[email protected].:tada:
Handy links:
:tada:This issue was addressed in #18884, which has now been successfully released as @fluentui/[email protected].:tada:
Handy links:
:tada:This issue was addressed in #18884, which has now been successfully released as @fluentui/[email protected].:tada:
Handy links:
:tada:This issue was addressed in #18884, which has now been successfully released as @fluentui/[email protected].:tada:
Handy links:
