fix(tooltip): prevent delayed tooltip after target moves - 22.0.x - #17475
Open
viktorkombov wants to merge 1 commit into
Open
fix(tooltip): prevent delayed tooltip after target moves - 22.0.x#17475viktorkombov wants to merge 1 commit into
viktorkombov wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a tooltip edge case where a delayed hover tooltip could open after its target has moved (e.g., due to Grid virtualization) without a pointerleave, resulting in stale/mispositioned or multiple visible tooltips. The solution adds pointer-position tracking and a hit-test check before opening delayed tooltips, with regression tests to lock the behavior.
Changes:
- Track latest pointer coordinates during delayed hover and validate via
elementFromPoint()before opening. - Support hit-testing both in the document and within Shadow DOM roots (via
getRootNode()). - Add targeted regression tests for moved-target delayed hover, no hit-test for zero-delay, and latest-pointer usage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| projects/igniteui-angular/directives/src/directives/tooltip/tooltip-target.directive.ts | Implements delayed-hover pointer tracking and hit-test gating prior to opening the tooltip (including ShadowRoot support). |
| projects/igniteui-angular/directives/src/directives/tooltip/tooltip.directive.spec.ts | Adds regression coverage and updates the hover helper to supply pointer coordinates when needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17465
Description
Fixes delayed tooltips opening after their target has moved away from the pointer.
This could occur when layout changes—particularly during grid virtualization—move or recycle a target during
showDelaywithout the browser emittingpointerleave. The pending timeout would then open a stale tooltip, sometimes resulting in incorrectly positioned or multiple visible tooltips.Implementation
For delayed hover interactions,
IgxTooltipTargetDirectivenow:elementFromPoint()before opening.The validation is limited to delayed hover interactions. Zero-delay tooltips, focus/click triggers,
showTooltip(), and coordinate-less synthetic events preserve their previous behavior.The fix is contained within the tooltip directive and does not introduce grid-specific handling.
Tests
Added regression coverage verifying that:
Tooltip test suite: 67/67 passing.
Components Affected
Tooltip, including tooltip targets rendered inside virtualized Grid, Tree Grid, and Hierarchical Grid cells.
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
Test Configuration:
Screenshots / Recordings
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)