Skip to content

fix(tooltip): prevent delayed tooltip after target moves - 22.0.x - #17475

Open
viktorkombov wants to merge 6 commits into
22.0.xfrom
vkombov/fix-17465-22.0.x
Open

fix(tooltip): prevent delayed tooltip after target moves - 22.0.x#17475
viktorkombov wants to merge 6 commits into
22.0.xfrom
vkombov/fix-17465-22.0.x

Conversation

@viktorkombov

Copy link
Copy Markdown
Contributor

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 showDelay without the browser emitting pointerleave. The pending timeout would then open a stale tooltip, sometimes resulting in incorrectly positioned or multiple visible tooltips.

Implementation

For delayed hover interactions, IgxTooltipTargetDirective now:

  • Tracks the latest pointer position.
  • Uses elementFromPoint() before opening.
  • Opens only when the target remains under the pointer.
  • Supports targets inside both document and Shadow DOM roots.

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:

  • A delayed tooltip remains closed when its target moves away.
  • Zero-delay hover interactions are not hit-tested.
  • The latest pointer position is used before opening.

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):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Test Configuration:

  • Angular version:
  • Browser(s):
  • OS:

Screenshots / Recordings

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@mddragnev mddragnev added ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification labels Aug 11, 2026
@mddragnev
mddragnev requested a review from igdmdimitrov August 14, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

grid tooltip version: 22.0.x virtualization ✅ status: verified Applies to PRs that have passed manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants