fix(tooltip): prevent delayed tooltip after target moves - #17474
Open
viktorkombov wants to merge 1 commit into
Open
fix(tooltip): prevent delayed tooltip after target moves#17474viktorkombov 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
Fixes a tooltip timing edge case where a delayed hover tooltip could still open after its target moved (e.g., during grid virtualization/scroll) without a corresponding pointerleave, leading to stale/mispositioned or multiple visible tooltips.
Changes:
- Track the last known pointer coordinates for delayed hover-triggered shows and revalidate via
elementFromPoint()right before opening. - Add Shadow DOM-aware hit testing by using the element’s root (
getRootNode()) when available, with a safe fallback. - Add regression unit tests covering target movement during delay, no hit-testing for zero-delay, and using the latest pointer position.
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 | Adds delayed-hover pointer position tracking + hit-test validation (incl. Shadow DOM root support) before opening the tooltip. |
| projects/igniteui-angular/directives/src/directives/tooltip/tooltip.directive.spec.ts | Adds regression coverage for delayed-hover validation and updates the hover helper to allow pointer coordinates. |
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)