Skip to content

fix(material/tooltip): tooltip inside sidenav hides after text update#32980

Closed
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:fix/tooltip-sidenav-text-update
Closed

fix(material/tooltip): tooltip inside sidenav hides after text update#32980
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:fix/tooltip-sidenav-text-update

Conversation

@yogeshwaran-c
Copy link
Contributor

Summary

  • Fixes tooltip inside mat-sidenav hiding when its text content is updated dynamically
  • When the tooltip overflows the sidenav (a scrollable ancestor) and its message is updated, updatePosition() triggers the overlay clip check which incorrectly detects the tooltip as clipped and hides it
  • Added _isRepositioningForMessage flag to skip the clip check during message-driven repositioning

Root Cause

  1. mat-sidenav content extends CdkScrollable, making it a registered scrollable ancestor
  2. Updating tooltip message triggers _updateTooltipMessage()updatePosition()positionChanges emission
  3. The positionChanges subscriber checks isOverlayClipped against scrollable ancestors
  4. Since the tooltip overlay (in the global overlay container) extends beyond the sidenav bounds, it's detected as "clipped" and hidden

Test plan

  • Added unit test verifying tooltip stays visible when message is updated inside a scrollable container
  • CI validates existing tooltip scroll-hide tests still pass
  • Manual verification with reproduction from issue

Fixes #27782

🤖 Generated with Claude Code

When a tooltip overflows a parent scrollable container (e.g. mat-sidenav)
and its text is updated dynamically, the tooltip incorrectly hides. This
happens because updating the message triggers a reposition, which causes
the overlay clip check to detect the tooltip extending beyond the
scrollable ancestor bounds and hide it.

Skip the overlay clip check when the reposition is triggered by a
message update rather than a user scroll event.

Fixes angular#27782

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pullapprove pullapprove bot requested review from tjshiu and wagnermaciel March 25, 2026 12:38
@google-cla
Copy link

google-cla bot commented Mar 25, 2026

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.

@crisbeto
Copy link
Member

This is pure hallucinated slop. Please stop pointing your Claude instance at random issues and relying on us to verify if the code it produced actually makes sense.

@crisbeto crisbeto closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(material/tooltip): tooltip inside sidenav hides after text update

2 participants