[tooltip] Preserve focus-opened tooltip on hover leave#4884
[tooltip] Preserve focus-opened tooltip on hover leave#4884michaldudak wants to merge 2 commits into
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,235.40 ms -156.25 ms(-11.2%) | Renders: 50 (+0) | Paint: 1,885.71 ms -243.36 ms(-11.4%)
10 tests within noise — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex Review (GPT-5.5)Reviewed the full PR diff against freshly fetched 1. Bugs / Issues (None)I did not find any branch-relevant correctness issues in the changed hover ownership path. Root Cause & Patch AssessmentThe patch addresses the actual ownership problem: a focus-opened tooltip should not be treated as hover-owned while focus remains on the trigger or popup. Updating Test Coverage AssessmentThe new Tooltip tests cover the important regressions: focus-open -> mouse leave -> blur/Escape, hover-open -> focus -> mouse leave, and pending hover-open not overwriting focus ownership. These run through the existing contained/detached/multiple-detached trigger matrix. Validated: I did not separately replay the new regression tests on RecommendationApprove ✅ The implementation is narrowly scoped, matches the shared hover-interaction architecture, follows the repo’s DOM utility conventions, and the relevant Tooltip/hook/type/lint validation passes. |
|
I've noticed this in the past, but didn't consider it to be important to fix or possibly even desirable, especially without |
Summary
Bug
A tooltip can be opened by focus and then closed by hover leave while the trigger still has focus. That leaves keyboard users with a tooltip that disappears even though the focus-open condition is still true.
Reproduction
Test plan
pnpm test:jsdom TooltipRoot --no-watchpnpm test:chromium TooltipRoot --no-watch