Skip to content

fix(Tooltip, Text, Heading, LineClamp): ignore stationary pointer entry - #11819

Closed
bezabyte wants to merge 3 commits into
meta:mainfrom
bezabyte:codex/issue-11605-tooltip-resting-pointer
Closed

bezabyte wants to merge 3 commits into
meta:mainfrom
bezabyte:codex/issue-11605-tooltip-resting-pointer

Conversation

@bezabyte

@bezabyte bezabyte commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Tooltip hover now waits for a real pointermove after pointerenter before starting its show timer. The same interaction contract is used by lazily mounted truncation tooltips in Text, Heading, and Lab's LineClamp.

The follow-up also:

  • arms the hover timer only on the first movement after entry;
  • disarms pending hover after pointer leave, mouse press, and Escape;
  • cancels a pending hide when the pointer returns to an already-open trigger, preserving the hover bridge;
  • composes LineClamp's caller pointer handlers with the shared hover path;
  • updates the affected hover tests to use browser-like pointer events while preserving touch-synthesized mouse events.

Why

When a dialog or other layout change places a new trigger beneath a resting mouse, Chromium can report pointerenter/mouseenter without any movement. The old Tooltip treated that as hover and opened after the delay, covering content the user had just opened. The fix waits for movement that follows the entry event, while keeping the existing hover bridge when a pointer returns from the tooltip surface to its trigger.

Before / after

Before: a trigger appearing beneath an unmoved pointer opened after the hover delay. The existing hover bridge already canceled a pending hide when the pointer returned to an open trigger, so this change preserves that behavior.

After: the trigger stays closed until the pointer actually moves over it; the timer runs once, dismissal stays closed until a fresh leave-and-enter sequence, and returning to the trigger cancels the pending hide. Keyboard focus and allowed touch/pen taps keep their existing behavior.

Verification

  • Focused Tooltip, useTooltip, and LineClamp suites: 149 passed.
  • Core typecheck and Lab typecheck: passed.
  • pnpm check:repo: passed before this follow-up; the follow-up is covered by the pre-commit repository checks below.
  • Strict lint, targeted Prettier, and git diff --check: passed.
  • Pre-commit checks: passed.

This is an event-order and timing fix with no visual styling change, so a screenshot would not honestly demonstrate the difference. The regression coverage asserts the stationary-pointer, one-shot timer, dismissal, and return-to-trigger states directly.

The remaining gate is the engineering-owner decision on the desktop Tooltip interaction contract.

Closes #11605

@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 17, 2026 4:51am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 15, 2026
@astracat-bot

astracat-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 17, 2026, 5:06 AM UTC

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:spec-owner-review Current knowledge records await owner approval labels Nov 15, 2026

@astracat-bot astracat-bot Bot 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.

Thanks for tracking this down: ignoring a hover that only a layout change caused does work in a real browser. This head can't be approved yet, because the reworded component:Tooltip FR3 needs an engineering owner's decision and there are blocking defects to fix whatever that decision is.

Waiting on an owner decision: the head rewrites FR3 so that a pointerenter with no pointermove no longer counts as entering the trigger, a case the current spec does not settle; an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner.

Blocking:

  • After a click on a tooltip trigger, or Escape, the next small pointer move on that trigger reopens the tooltip 200 ms later, because handlePointerMove re-arms the show timer on every pointermove and neither the press nor the Escape close stops it (useTooltip.tsx:516-524, against FR6 and AR2); start the timer only on the first move after pointerenter, and disarm it on leave, press and Escape.
  • Every pointermove restarts the show delay (useTooltip.tsx:523), so a pointer moving across a trigger sees nothing until it rests for delay ms, where FR3 opens it delay ms after entry.
  • 36 tests in 25 files fail on this head and pass on the base, because they open tooltips with fireEvent.mouseEnter: InfoTip.pin.test.tsx (5), InfoTip.test.tsx (2), SideNav.test.tsx (3), InputClearButton.test.tsx, Lab's CommentPin.test.tsx, and the "shows the reason tooltip on hover" disabledMessage test of CheckboxInput, CheckboxList, ComplexSelector (5), DateInput, DateRangeInput, DateTimeInput, FileInput, MultiSelector, NumberInput, PowerSearch, RadioList, SegmentedControl, Selector, Slider, Switch, TextArea, TextInput, TimeInput, Tokenizer and Typeahead.
  • packages/lab/src/LineClamp/LineClamp.tsx:539 still composes the removed tooltipInterest.onPointerEnter, so Lab's typecheck fails (TS2339) and a clamped LineClamp no longer mounts its tooltip on hover; compose onPointerMove there, as Text and Heading now do.
  • Desktop behavior change needs an owner decision: useTooltip.tsx:516-524 changes when a mouse or pen hover opens every Tooltip, so either cite FR3 in the description and have an engineering owner comment /approve-spec for the head, or cite an explicit owner decision.
  • The new stationary tests (useTooltip.test.tsx:106-114 and the first half of Tooltip.test.tsx:129-146) fire pointerEnter alone, which opens nothing on the base either, so they would not catch the old mouseenter path coming back; fire fireEvent.mouseEnter after pointerEnter, the sequence Chromium sends.

Non-blocking: the new onPointerMove handlers on Text and Heading fall outside the title's Tooltip scope, so naming Text and Heading in it would cover them.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the changeset says Tooltip waits for pointer movement before opening on hover. True for the first open (useTooltip.tsx:516-524, :775), but each move also restarts the delay.
  • Claim: hover waits for a real pointermove after pointerenter before its show timer starts. Verified: in a real-Chromium capture, a trigger mounted under a still pointer stays closed on the head.
  • Claim: Text and Heading truncation tooltips use the same rule. Verified (TruncationTooltip.tsx:116-123, Text.tsx:328-331, Heading.tsx:325-328); Lab LineClamp, a third user of that hook, was not updated.
  • Claim: Chromium reports an enter with no movement after a layout change, so the base opens the tooltip. Verified in real Chromium on the base.
  • Claim: after the change, the trigger stays closed until the pointer moves, and keyboard focus and touch or pen taps keep their behavior. Verified: the focus and tap paths are unchanged, and the Tooltip and useTooltip suites pass.
  • Claim: the Tooltip, useTooltip, Text and Heading suites pass (188). Verified: 62 + 37 + 53 + 36 pass on the head.
  • Claim: Core typecheck, lint, formatting and repository checks pass. Not rerun; Lab's typecheck fails at LineClamp.tsx:539.
  • Claim: the regression tests assert the stationary-pointer state directly. Partly true: the Tooltip tests assert it with pointerEnter alone, which also passes on the base (useTooltip.test.tsx:106-114); the Text test fails on the base as it should (Text.test.tsx:538-554).
  • Claim: there is no visual styling change. Verified: the diff changes no style.
  • File packages/core/src/Tooltip/useTooltip.tsx: dismissed tooltip reopens on a move, delay restarts on every move, desktop decision.
  • File packages/core/src/Text/TruncationTooltip.tsx: interface rename leaves Lab LineClamp broken.
  • File packages/core/src/Text/Text.tsx: clear (scope note).
  • File packages/core/src/Heading/Heading.tsx: clear (scope note).
  • File packages/core/src/Tooltip/Tooltip.test.tsx: stationary half passes on the base.
  • File packages/core/src/Tooltip/useTooltip.test.tsx: stationary test passes on the base.
  • File packages/core/src/Text/Text.test.tsx: clear; the new test fails on the base as it should.
  • File packages/core/src/Heading/Heading.test.tsx: clear.
  • File docs/specs/components/Tooltip/Tooltip.spec.md: FR3 rewording waits on an owner decision.
  • File .changeset/tooltip-resting-pointer.md: clear.

Automated review (maintainer link)

| FR1 | The rendered tooltip contains one owned surface, `role="tooltip"`, carrying the `tooltip` target, at most 300 px wide, with the supplied `content` inside; content has no separate target and there is no arrow. | Current source, docs, and tests |
| FR2 | Trigger wiring: a single string or number child is wrapped in a focusable inline span; element `children` attach to their first element; `anchorRef` attaches to that element. The trigger's `aria-describedby` gains the tooltip id, merged with and later restored to any existing value. Implementation gap: the Tooltip wires its element child or `anchorRef` target when it mounts, so a trigger element replaced after mount, or a trigger whose own `aria-describedby` changes, keeps the first wiring until the Tooltip mounts again (Current-state impact). | Current source and tests |
| FR3 | On a hover-capable pointer, entering the trigger opens after `delay` ms; leaving closes after `hideDelay` ms. With `hideDelay` 0 a short bridge lets the pointer move onto the surface without closing it, and the surface stays open while hovered. | WCAG 1.4.13; tests |
| FR3 | On a hover-capable pointer, a `pointermove` on the trigger after it is entered opens after `delay` ms; a `pointerenter` caused only by layout placing the trigger beneath a stationary pointer does not count as entering. Leaving closes after `hideDelay` ms. With `hideDelay` 0 a short bridge lets the pointer move onto the surface without closing it, and the surface stays open while hovered. | WCAG 1.4.13; tests |

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.

This rewording changes FR3's requirement, so it waits on an engineering owner's decision. As written, "a pointermove on the trigger after it is entered opens after delay ms" also describes the reopen after a press, and the restart on every move. If the direction is approved, stating that only the first move after entering starts the delay would match FR6's press and Escape dismissal.

@bezabyte bezabyte changed the title fix(Tooltip): ignore stationary pointer entry fix(Tooltip, Text, Heading): ignore stationary pointer entry Nov 16, 2026
@bezabyte

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in 43822c26b7a8c7bfa88710d905a7a9bf2746ae48.

The hover path now starts only on the first real pointer move after entry, and it is disarmed on leave, mouse press, and Escape. That prevents repeated moves from restarting the delay and prevents a dismissed tooltip from reopening until the pointer genuinely leaves and re-enters. LineClamp now preserves the caller's onPointerEnter and composes the shared onPointerMove path.

I updated the affected tests to model the browser event sequence, including the native mouseenter that can accompany a stationary pointer, while leaving touch-synthesized mouse events intact.

Verification: 186 focused Tooltip/LineClamp/CommentPin tests passed; 2,927 changed hover tests passed. Core and Lab typechecks, check:repo, strict lint (0 errors), pre-commit, and git diff --check all passed. Three unrelated Korean locale assertions remain environment-sensitive in DateTimeInput/TimeInput.

The remaining action is the engineering-owner decision on the desktop Tooltip interaction contract.

@astracat-bot astracat-bot Bot 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.

Thanks for the follow-up: the delay now runs once from the first move, a press or Escape keeps the tooltip closed, Lab LineClamp is wired, and the suites pass. This head still can't be approved, because the reworded component:Tooltip FR3 needs an engineering owner's decision and there are blocking defects to fix whatever that decision is.

Waiting on an owner decision: the head rewrites FR3 so that a pointerenter with no pointermove no longer counts as entering the trigger, a case the current spec does not settle; an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so if they are an engineering owner.

Blocking:

  • Moving from the tooltip back onto its trigger, or leaving and coming back within hideDelay, now closes the tooltip while the pointer rests on the trigger, because handlePointerMove returns early for an open layer and never cancels the pending hide (useTooltip.tsx:535-541, against FR3's hover bridge and AR2's WCAG 1.4.13 persistence); cancel the pending hide when the trigger is re-entered with the tooltip open, and add a trigger, tooltip, trigger test.
  • Desktop behavior change needs an owner decision: every mouse and pen hover on every Tooltip now starts on a move instead of on entry (useTooltip.tsx:529-544, :792-793), so either gate it to touch input or cite the owner decision that covers it.
  • The description says main could restart the delay on repeated movement or reopen a dismissed tooltip, but main listens to mouseenter, which fires once per entry, and keeps a pressed or Escaped tooltip closed after a move; drop those clauses from "Why" and "Before / after".

Non-blocking: Lab LineClamp's new onPointerMove handler falls outside the title's scope (Tooltip, Text, Heading), and the comment at useTooltip.tsx:530-534 would read better in active voice.

Claims and files checked

Review mode: full; reason: author-not-engowner

  • Claim: the changeset says Tooltip waits for pointer movement before opening on hover. Verified (useTooltip.tsx:529-544; a real-Chromium capture keeps a trigger mounted under a still pointer closed).
  • Claim: hover waits for a real pointermove after pointerenter before its show timer starts. Verified, same evidence.
  • Claim: lazily mounted truncation tooltips in Text, Heading and Lab's LineClamp use the same rule. Verified (TruncationTooltip.tsx:116-123, Text.tsx:328-331, Heading.tsx:325-328, LineClamp.tsx:539-543); the new Text test fails on the base and passes here.
  • Claim: the timer arms only on the first move after entry, so later moves do not restart it. Verified (useTooltip.tsx:538; the new "does not restart the show delay" test).
  • Claim: leaving, a mouse press and Escape disarm pending hover, so a dismissed tooltip does not reopen under a still pointer. Verified (useTooltip.tsx:548, :669-670, :961; the new press and Escape tests).
  • Claim: LineClamp keeps the caller's pointer handlers and composes the shared hover path. Verified (LineClamp.tsx:539-543); Lab's source typechecks.
  • Claim: the hover tests now use browser-like pointer events while keeping touch-synthesized mouse events. Verified (for example Tooltip.test.tsx:473-477 still fires a touch pointerEnter then mouseEnter).
  • Claim: Chromium reports an enter with no movement after a layout change, so the old Tooltip opened after the delay. Verified in real Chromium on the base.
  • Claim: before this change, repeated movement or a dismissal could leave a stale hover timer, and a second move could restart the timer or reopen a dismissed tooltip. False for main: mouseenter fires once per entry, and after a press or Escape a move leaves the tooltip closed on the base.
  • Claim: after the change the trigger stays closed until the pointer moves, the timer runs once, and press or Escape dismissal holds until a fresh leave and enter. Verified, but returning to the trigger with a hide pending now closes the tooltip (blocking above).
  • Claim: keyboard focus and allowed touch and pen taps keep their behavior. Verified: those paths are unchanged and their suites pass.
  • Claim: the focused Tooltip, useTooltip, LineClamp and CommentPin suites pass (186). Verified: 62 + 40 + 46 + 38 pass.
  • Claim: all changed hover suites pass (2,927). Verified as a superset: 110 tooltip-related test files, 6,970 tests, pass on this head, including every changed test file.
  • Claim: three Korean locale assertions in DateTimeInput and TimeInput are environment-sensitive. Not reproduced: both suites pass here.
  • Claim: Core typecheck, check:repo, strict lint, pre-commit and git diff --check pass. Not rerun; Lab's source typecheck passes.
  • Claim: no visual styling change. Verified: no style changes.
  • Claim: closes the linked still-pointer issue. Verified for the issue's reproduction in Chromium.
  • File packages/core/src/Tooltip/useTooltip.tsx: returning to the trigger closes the tooltip; desktop change needs an owner decision; passive comment (non-blocking).
  • File docs/specs/components/Tooltip/Tooltip.spec.md: FR3 rewording waits on an owner decision.
  • File packages/lab/src/LineClamp/LineClamp.tsx: clear apart from the scope note.
  • Files packages/core/src/Text/TruncationTooltip.tsx, Text/Text.tsx, Heading/Heading.tsx: clear.
  • Files packages/core/src/Tooltip/Tooltip.test.tsx, Tooltip/useTooltip.test.tsx, Text/Text.test.tsx, Heading/Heading.test.tsx: clear; the stationary tests fail on the base as they should; no test returns to the trigger with a hide pending.
  • File .changeset/tooltip-resting-pointer.md: clear.
  • Files with the hover-sequence test update (CheckboxInput, CheckboxList, ComplexSelector, DateInput, DateRangeInput, DateTimeInput, InputClearButton, FileInput, InfoTip pin, InfoTip, MultiSelector, NumberInput, PowerSearch, RadioList, SegmentedControl, Selector, SideNav, Slider, Switch, TextArea, TextInput, TimeInput, Tokenizer, Typeahead, Lab CommentPin): clear; all pass.

Automated review (maintainer link)

Comment on lines +530 to +534
// A pointerenter can be caused by layout moving the trigger under a
// stationary pointer. Only pointermove is evidence that the user entered
// the trigger, so that case must not start the hover timer.
// Once started, the timer is not restarted by subsequent pointermoves:
// the delay is measured from the first move after entry.

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.

Non-blocking: this comment is passive ("can be caused by", "is not restarted", "is measured"). A shorter active version: "Layout can move the trigger under a still pointer and fire pointerenter. Only a pointermove shows that the user entered. The first move starts the delay; later moves do not restart it."

@bezabyte bezabyte changed the title fix(Tooltip, Text, Heading): ignore stationary pointer entry fix(Tooltip, Text, Heading, LineClamp): ignore stationary pointer entry Nov 17, 2026
@bezabyte

Copy link
Copy Markdown
Contributor Author

Addressed the concrete blocking review item in the latest push:

  • handlePointerMove now cancels a pending hide when the pointer returns to an already-open trigger.
  • Added a regression covering leave, return before hideDelay, and continued visibility.
  • Removed the inaccurate description claims about main restarting the timer or reopening a dismissed tooltip.
  • Added LineClamp to the PR title scope.

The desktop interaction-contract decision remains explicitly open for the engineering owner.

@astracat-bot astracat-bot Bot 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.

This head can't be approved yet: the reworded component:Tooltip FR3 needs an engineering owner's decision, and two blocking items need fixing whatever that decision is. Returning to an open trigger now keeps the tooltip open, with a regression test, which resolves the earlier hover-bridge finding.

Waiting on an owner decision: FR3 would no longer count a pointerenter that layout causes under a still pointer as entering the trigger, a case the current spec does not settle; an engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so if they are an engineering owner).

Blocking:

  • Desktop behavior change needs an owner decision: every mouse and pen hover on every Tooltip and truncation tooltip now starts on the first move instead of on entry (useTooltip.tsx:529-547, :795-796), so gate it to touch input or cite the owner decision that covers it.
  • The description's new "Before" line says main did not cancel a pending hide when the pointer returns to an open trigger, but main cancels it through scheduleShow's clearTimeouts(), so drop that line and describe the cancel as keeping main's behavior.
Claims and files checked

Review mode: full; reason: author-not-engowner

  • Claim: hover waits for a real pointer move after entering, also for the Text, Heading and LineClamp truncation tooltips: verified (useTooltip.tsx:529-547, TruncationTooltip.tsx:116-123; the stationary tests fail on the base).
  • Claim: the timer starts only on the first move after entry: verified ("does not restart the show delay on each pointer move").
  • Claim: leaving, a mouse press and Escape disarm pending hover: verified (useTooltip.tsx:551, :672, :964; the press and Escape tests).
  • Claim: returning to an open trigger cancels a pending hide: verified (useTooltip.tsx:542-545; the new test fails on the previous head; browser check).
  • Claim: LineClamp composes the caller's pointer handlers with the shared hover path: verified (LineClamp.tsx:539-547).
  • Claim: hover tests use browser-like pointer events and keep touch-synthesized mouse events: verified (the Tooltip.test.tsx tap helper).
  • Claim: before, a trigger under an unmoved pointer opened after the delay: verified (browser check on the base).
  • Claim: before, returning to an open trigger did not cancel a pending hide: false (the base keeps the tooltip open; browser check and unit probe).
  • Claim: keyboard focus and allowed touch or pen taps keep their behavior: verified (focus and touch suites pass).
  • Claim: focused suites, Core and Lab typechecks, strict lint and Prettier pass: verified (3,547 tests in 42 files; both typechecks; strict ESLint and Prettier on the changed files).
  • Claim: the repository checks and pre-commit passed before this follow-up: not rechecked as stated; the changeset and knowledge checks pass on this head.
  • Changeset: Tooltip waits for pointer movement before opening on hover: verified.
  • Files: useTooltip.tsx: desktop-decision finding; Tooltip.spec.md: waits on the owner decision; TruncationTooltip.tsx, Text.tsx, Heading.tsx, LineClamp.tsx: clear; useTooltip.test.tsx, Tooltip.test.tsx, Text.test.tsx, Heading.test.tsx: clear; the 25 other migrated test files: clear; the changeset: clear.

Automated review (maintainer link)

@bezabyte

Copy link
Copy Markdown
Contributor Author

Updated the PR description to correct the stale “Before” statement. The base implementation already canceled a pending hide when the pointer returned to an open trigger; this change preserves that hover-bridge behavior. The remaining desktop interaction/spec decision is intentionally left for an engineering owner.

cixzhang added a commit to shashank03-dev/astryx that referenced this pull request Nov 21, 2026
… two more cases

Maintainer edit after the specification review:
- Tooltip FR3 states its meaning: entering means the pointer moves onto
  the trigger; a trigger that appears or moves under a pointer that has not
  moved is not entered until the pointer moves. The wording follows
  bezabyte's proposal in meta#11819.
- Two browser cases keep the line from reaching too far: a wheel or
  keyboard scroll that brings the trigger under a still mouse opens nothing
  until the mouse moves; a mouse already over the trigger when it mounts
  opens it on its first move.
- The still-pointer unit cases press the trigger, which sets the document's
  interaction modality. They now reset it, so the keyboard-focus cases main
  added after this branch began still run with the keyboard default.

Co-authored-by: bezabyte <[email protected]>
cixzhang added a commit that referenced this pull request Nov 24, 2026
…ooltip (#11831)

* fix(Tooltip): a trigger that appears under a still pointer opens no tooltip

A browser sends a trigger its arrival (mouseenter) when the trigger appears or moves under a pointer that does not move, as after a click that opens a dialog whose close button lands under the pointer. The tooltip took that arrival as a hover and opened. Now the arrival only arms the hover, and the show delay starts on the first pointermove or mousemove over the trigger. A pointer that moves onto the trigger sends that move in the same frame, so a real hover opens as before. Firefox sends the pointermove before the mouseenter, so the mousemove after it counts too.

Truncated Text and Heading (and Lab's LineClamp) mount their tooltip on the first hover. That hover now also counts from the first mouse or pen pointermove, not from pointerenter, which the browser sends with the arrival. A mouse press still ends that hover until the pointer leaves.

Tests that opened a tooltip with a bare mouseEnter or pointerEnter now also send the move a browser sends with it.

Fixes #11605

* fix(Tooltip): the arrival comment describes the current hover path

* Merge branch 'main' into fix/tooltip-still-pointer

* fix(Tooltip): record what entering the trigger means, and pin it with two more cases

Maintainer edit after the specification review:
- Tooltip FR3 states its meaning: entering means the pointer moves onto
  the trigger; a trigger that appears or moves under a pointer that has not
  moved is not entered until the pointer moves. The wording follows
  bezabyte's proposal in #11819.
- Two browser cases keep the line from reaching too far: a wheel or
  keyboard scroll that brings the trigger under a still mouse opens nothing
  until the mouse moves; a mouse already over the trigger when it mounts
  opens it on its first move.
- The still-pointer unit cases press the trigger, which sets the document's
  interaction modality. They now reset it, so the keyboard-focus cases main
  added after this branch began still run with the keyboard default.

Co-authored-by: bezabyte <[email protected]>

* fix(Tooltip): a press before the first move ends the arrival too

A press on a trigger that appeared under a still mouse left the arrival
unmoved, so the next small move opened the tooltip over the control just
pressed. The press now clears it, as a press already ends a hover that
moved. A unit case covers arrival, press, then move.

* fix(Tooltip): WebKit's zero-movement move after a scroll is not a first move

Maintainer edit. After a scroll brings the trigger under a still mouse,
WebKit sends a trusted pointermove and mousemove with no movement at the
arrival's point; the hook counted it as the first real move and opened
the tooltip. A trusted move with zero movement at the point the arrival
recorded is now the arrival again. The wheel and keyboard scroll cases
move into TooltipStillPointerScroll.interaction.browser.spec.ts, so CI's
WebKit leg runs them on a Tooltip change.

* fix(Tooltip): decide a still arrival by where the mouse last moved, not by movement

Maintainer edit. WebKit reports no movement on any move, so the zero-
movement rule also swallowed the only move of a one-step arrival and the
tooltip never opened. The trigger now notes, at its arrival, whether the
mouse last moved at that same point (the window's input stream, which the
tooltips keep listening to pointermove); only then is a trusted move at
that point the arrival again. A mouse that came from elsewhere opens the
tooltip on its first move. The interaction spec adds the one-step hover,
so CI's WebKit leg covers it.

* fix(Tooltip): the last-pointer subscription lives only while a trigger is mounted

Maintainer edit, per Specs' conditions: the tooltips' pointermove
subscription to the window input stream is counted per window and ends
with the last mounted trigger (a listener-count test pins one listener
for two triggers, removed with the last). Its handler stores nothing and
reads no layout; the stream stores the point. react-component-runtime
lists the tooltips' last-pointer reading among the stream's subscribers.

* fix(Tooltip): Firefox's move before mouseenter is a real arrival

Maintainer edit. Firefox sends the move that brings the mouse onto the
trigger before the mouseenter, at the same point, so the window's last
mouse point already equals the arrival and a one-step hover read as a
resting arrival (no tooltip). The trigger now notes where it last heard a
move before its arrival (reset on leave); a move there at the arrival's
point means the mouse came from elsewhere. Firefox 151, Chromium 149:
a11y spec 15/15 and interaction spec 9/9 (x3).

* Merge branch 'main' into fix/tooltip-still-pointer

* fix(Tooltip, Text): one still-mouse check; a hover measures cut text once

Maintainer edit, after the main merge. The input stream now keeps each
window's mouse point before its latest pointermove; isMouseMove tells a
move from WebKit's post-scroll move at a still mouse's point. Tooltip
triggers and truncated text both use it, each holding a pointermove
subscription while mounted. The truncation tooltip's first hover is the
first real move after an enter, and it calls want() once per hover, so a
fitting Table cell measures once, as on main. main's measure-on-interest
Text tests send the hover's move. New: a once-per-hover unit case and
WebKit/Firefox/Chromium scroll cases for truncated Text and Heading.

* refactor(Tooltip, Text): the input stream holds mouse moves once per window

Maintainer edit for review. holdMouseMoves(view) in the input stream keeps
one counted pointermove subscription per window, and the stream records a
held window's last two mouse points on it. Tooltip triggers hold their
element's window, and truncated Text and Heading hold theirs while they can
show a tooltip, instead of one no-op subscriber each.

* fix(LineClamp): hold its window for the still-mouse check; docs

Maintainer edit for review. Lab's LineClamp passes its element to the
truncation tooltip hook, as Text and Heading do. The changeset says the
scroll case holds once the mouse has moved on the page; holdMouseMoves
and isMouseMove get their JSDoc and the file header names them.

* docs(Tooltip): the scroll case holds once the mouse moved since the trigger appeared

Maintainer edit for review: the changeset's qualifier matches what the
WebKit check gives, and the mouseMoves comment is split into short
sentences.

* test(Text): a mouse press before the first move ends the hover

Maintainer edit for review: the case fails without the truncation
tooltip's press flag and passes with it, as the description claims. The
isMouseMove comment is split to short lines.

* docs(Tooltip): split the isMouseMove comment's last sentence

* Merge branch 'main' into fix/tooltip-still-pointer

* fix(Tooltip): hold mouse moves only while a hover can open the tooltip

Maintainer edit. A controlled tooltip (isOpen) or a disabled one cannot
open on a hover, so it needs no still-mouse check. useTooltip now holds the
input stream's mouse moves in an effect keyed on enabled-and-uncontrolled,
not for every attached trigger. A page of controlled or disabled tooltips,
such as a Slider's thumb, adds no window listener at rest (AST-094 FR24's
Slider check holds as on main). A unit case pins the hold across disabled,
controlled and uncontrolled.

* fix(Tooltip): take the mouse-move hold on the trigger's own window

Maintainer edit. The hold now follows the trigger: its ref callback takes
or moves the hold when the trigger attaches, detaches or moves to another
document (an iframe), and an effect follows a later change to isEnabled or
isOpen. Before, an effect held whichever window it saw at mount, so a
trigger attached later or moved into an iframe was not held. A unit case
pins the hold across a late attach and a move into an iframe.

* fix(Tooltip): keep the mouse-move hold across a same-commit re-attach

Maintainer edit. A trigger whose ref changes identity on each render is
detached and re-attached in the same commit. Releasing the hold at once
dropped the window's last mouse point, so WebKit's repeated move after a
scroll counted as a first move. The detach now re-syncs the hold a
microtask later. A unit case pins one listener across such a re-render.

* style(Tooltip): put the touch comment back above the touch return

Maintainer edit. The arrival reset in handleMouseLeave moves above the
comment that explains the touch return, so the comment sits on the line
it describes. No behavior change.

* Merge branch 'main' into fix/tooltip-still-pointer

* test(Text): #12653's hover-then-focus case moves the mouse onto the text

Maintainer edit. Since this branch, a hover opens a truncation tooltip on
the first mouse move, not on an arrival alone. The case from #12653 now
sends a move after its pointerenter, like the other Text hover cases.

* test(ci): list the Tooltip still-pointer spec among the Firefox hover specs

Maintainer edit. TooltipStillPointer.a11y.browser.spec.ts moves the pointer
over Tooltip triggers, so FIREFOX_HOVER_SPECS names it and Firefox runs it,
as the list's completeness test requires.

* Merge branch 'main' into fix/tooltip-still-pointer

* docs(Text): name what the truncation tooltip's mouse-move hold tells apart

Maintainer edit. Comment only: active voice, and says isMouseMove tells a
still mouse's repeated move from a real move.

* Merge branch 'main' into fix/tooltip-still-pointer

* Merge branch 'main' into fix/tooltip-still-pointer

* Merge branch 'main' into fix/tooltip-still-pointer

* Merge branch 'main' into fix/tooltip-still-pointer

Co-authored-by: Cindy Zhang <[email protected]>
@cixzhang

Copy link
Copy Markdown
Contributor

(Posted by Cindy's agent.) Thank you for this, @bezabyte! Your fix took the same approach to the same bug: wait for a real pointer move after entry, including for the lazily mounted truncation tooltips in Text, Heading and LineClamp. That fix has now merged in #11831, and the Tooltip record's new definition of "entering" follows the wording you proposed here, credited in the commit. Closing this one since that change covers it.

@cixzhang cixzhang closed this Nov 24, 2026

This branch was successfully deployed

1 active deployment
Preview — e00a9673 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Tooltip: opens under a pointer that never moved, when its trigger appears beneath it

3 participants