Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tooltip] frozen hovered state, if onPointerLeave event is skipped #3299

Open
blindbeat opened this issue Dec 20, 2024 · 0 comments
Open

[Tooltip] frozen hovered state, if onPointerLeave event is skipped #3299

blindbeat opened this issue Dec 20, 2024 · 0 comments

Comments

@blindbeat
Copy link

Bug report

Current Behavior

When Tooltip is open and windows (browser) lose focus, tooltip stays open, as pointerLeave event never happens.

It's particularly an issue in two cases:

  1. If user uses multiple apps (browser + something) and change focus with keyboard, while browser stays in view.
  2. Another usual example is if tooltip is hoverable and touches screen edge, and then mouse leaves browser from tooltip side, adjusted to window edge

In both cases tooltip stays active, while it lost semantic focus.

Expected behavior

When window lose focus, tooltip should close

Reproducible example

CodeSandbox Template

  1. hover over trigger
  2. move mouse out of the window through the adjusted edge (left)

Suggested solution

One of two:

  • Add window blur and/or pointerLeave event handlers as triggers for open state
  • Utilize Visibility API for the same purpose

Your environment

Software Name(s) Version
Radix Package(s) Tooltip 1.1.5
React n/a 18.3.1
Browser Chrome Version 131.0.6778.139
Node n/a v22.11.0
npm/yarn npm 10.9.0
Operating System Linux, Ubuntu 24.10
@blindbeat blindbeat changed the title [Tooltip] frozen hovered state, if onPointerLeave events is skipped [Tooltip] frozen hovered state, if onPointerLeave event is skipped Dec 20, 2024
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

No branches or pull requests

1 participant