Skip to content

fix(material/tooltip): prevent tooltip from showing when hovering unrelated elements - #33717

Open
pandikapinata wants to merge 1 commit into
angular:mainfrom
pandikapinata:fix/tooltip-select-popover-hover
Open

fix(material/tooltip): prevent tooltip from showing when hovering unrelated elements#33717
pandikapinata wants to merge 1 commit into
angular:mainfrom
pandikapinata:fix/tooltip-select-popover-hover

Conversation

@pandikapinata

Copy link
Copy Markdown

A trigger can have a popover-based overlay nested inside it (e.g. an open mat-select panel), and that overlay's full-viewport backdrop ends up as a DOM descendant of the trigger. mouseenter fires on an element and all of its ancestors, so hovering anywhere on the page while such a backdrop was present re-fired mouseenter on the trigger, showing the tooltip even though the pointer wasn't visually near it.

Guards the mouseenter handler by checking that a trusted pointer event is actually within the trigger's own bounds before showing the tooltip.
Synthetic events dispatched in tests aren't trusted, so existing test coverage is unaffected.

Fixes #32747

@pullapprove
pullapprove Bot requested review from crisbeto and ok7sai August 22, 2026 14:47
@google-cla

google-cla Bot commented Aug 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@pandikapinata

Copy link
Copy Markdown
Author

recheck

@pandikapinata
pandikapinata force-pushed the fix/tooltip-select-popover-hover branch from 652bb94 to 8dc3a9c Compare August 22, 2026 15:18

@crisbeto crisbeto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This isn't a good way to fix it, because it can end up ignoring events from nested elements that may be sticking out of the trigger (e.g. how we have the touch targets on buttons). It'll break a ton of tests internally and it seems like it's breaking some of the external ones as well.

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(overlay): Weird tooltip issue with the new popover overlay.

2 participants