Skip to content

fix(core): a tap is not swallowed beside a control no tap can reach - #13009

Draft
vjeux wants to merge 1 commit into
meta:mainfrom
vjeux:fix/hit-area-unreachable-neighbour
Draft

vjeux wants to merge 1 commit into
meta:mainfrom
vjeux:fix/hit-area-unreachable-neighbour

Conversation

@vjeux

@vjeux vjeux commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

User impact

Under a finger, a tap on a control's grown touch area is swallowed when a control that no tap can reach is nearer the press. The browser targets the visible control, but its click handler never runs. Every tap at that spot is swallowed.

In a phone app (test), a row button 20 px tall grows its touch area 12 px below it. A covered panel keeps a pager button there, in an inert subtree with content-visibility: hidden. A press 3 px below the row is 0 px from the pager. Only a tap elsewhere on the row opens it.

Problem and solution fit

  1. Why it occurs: at a touch's click, the press check swallows the click when an interactive element is nearer the press. It drops only zero-size boxes.
  2. Why it harms: nothing takes the tap.
  3. Why it matters: the control looks reachable, yet it cannot be operated from that spot.

The press check now skips a neighbour that is disabled, in an inert subtree, has pointer-events: none, or fails checkVisibility({checkVisibilityCSS: true}). Without that method, it reads visibility and an ancestor's content-visibility: hidden.

Expected behavior and authority

AST-094 FR42 grows a touch target "up to halfway to a neighboring target", "so each element stays reachable". A control that no tap can reach is no such target. No record changes.

Smallest restoration

Evidence

  • Reproduction before the change: on main, six new unit cases fail. The new browser spec fails 5 of 6 tests in Chromium and in WebKit.
  • Result after the change: all 83 hit-area unit tests pass. The browser spec passes 30 of 30 runs in each engine.
  • Representative unchanged path: a neighbour that takes taps, even at opacity 0, still swallows a tap nearer it.
  • Regression test or other mutation-sensitive proof: the cases above.

Scope

Components: touch hit area (utils/hitArea.ts)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

pnpm exec vitest run packages/core/src/utils/hitArea.test.ts packages/core/src/utils/touchHitArea.test.tsx
pnpm exec playwright test --config playwright.interaction.config.ts --project=chromium --repeat-each=5 hitAreaUnreachableNeighbour
pnpm exec playwright test --config playwright.interaction.config.ts --project=webkit --repeat-each=5 hitAreaUnreachableNeighbour
  • Unit, on main 49473f0: the six new cases for a neighbour that no tap can reach fail. Three unchanged-path cases pass: a neighbour that takes taps, one drawn at opacity 0, and the growth case that reads no style.
  • Unit, with the fix: 83 of 83 pass in hitArea.test.ts and touchHitArea.test.tsx.
  • Browser on main, with real touchscreen taps in the phone context: 5 of 6 tests fail per engine, each with the row clicked 0 times. The inert subtree whose contents are skipped is among them.
  • Browser, with the fix: 30 of 30 runs pass in Chromium and in WebKit.

Under a finger, a tap on a control's grown touch area is swallowed when
a fresh measurement at its click puts a neighbour nearer the press.
That neighbour could be one that no tap can reach: inside an inert
subtree, disabled, hidden by visibility or by skipped content, or with
pointer-events: none. Every tap at that spot was then lost.

The press check now skips such a neighbour. The measuring pass still
reads no style, so a hit area's growth is unchanged. Opacity does not
count, since a control drawn at opacity 0 still takes taps.
@vercel

vercel Bot commented Nov 19, 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 19, 2026 9:36pm UTC

Request Review

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

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Nov 19, 2026, 9:51 PM UTC

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@cixzhang cixzhang added ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) labels Nov 19, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 1339e47

@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.

Requesting changes: the fix restores the tap as described in a real browser, but the release note and description need corrections and one size report before approval.

  • The title and the changeset's first sentence say a tap is no longer swallowed beside any neighbour that no tap can reach, yet at this head a neighbour behind an open modal dialog, or one covered by the control's own panel, still swallows it, so please name the states takesTaps handles (disabled, inside an inert subtree, hidden by visibility or skipped content, pointer-events: none) and say that those other neighbours still keep the tap.
  • The description says the press is "0 px from the pager", but in the browser spec it cites the press is 2 px from it (PRESS y is 123 and .spot starts at 125), so please correct the figure.
  • hitArea.ts is a shared module, so the description needs its first-load gzip delta on the four reference pages from pnpm size:pages (for reference: docs +0 B, form +166 B, menu +153 B and table +149 B).

One optional suggestion: split the 26-word sentence in the takesTaps comment into shorter ones, as the inline note shows.

Claims and files checked

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

  • Changeset, a tap runs the control beside any neighbour no tap can reach: false (a neighbour behind an open modal dialog or under a covering panel still swallows it).
  • Changeset, before the fix an inert, disabled, visibility-hidden, skipped-content or pointer-events-none neighbour swallowed every tap there: verified (base, Chromium).
  • Changeset, a neighbour that takes taps, even at opacity 0, still keeps a tap nearer it: verified (unit and browser tests).
  • Description, the browser hit-tests the control but its click handler never ran: verified (hit test returns the row; 0 clicks on the base).
  • Description, the 20 px row grows 12 px below and the covered pager sits in an inert, content-visibility hidden subtree: verified (browser spec).
  • Description, the press is 0 px from the pager: false (2 px).
  • Description, the check skips disabled, inert, pointer-events none and checkVisibility-hidden neighbours, with a style fallback: verified (hitArea.ts:725-757).
  • Description, it runs only for a neighbour already nearer, and the measuring pass reads no style and grows the same: verified (hitArea.ts:1148-1151; unit test).
  • Description, opacity is excluded because Core's checkbox, switch and radio inputs take taps at opacity 0: verified (their input styles).
  • Description, content behind an open modal dialog is not covered: verified (browser probe).
  • Description, the two named open pull requests that edit the candidate read merge cleanly, and the named draft conflicts in two hunks: verified (two conflict blocks in hitArea.ts, plus one in hitArea.test.ts).
  • Description, six new unit cases fail before and 83 tests pass after, with three unchanged-path cases passing on both: verified.
  • Description, the browser spec fails 5 of 6 before and passes every run after, in Chromium and WebKit: verified in Chromium; WebKit not reproduced here.
  • Description, no new public API and no internal context: verified.
  • File .changeset/hit-area-unreachable-neighbour.md: finding (scope wording).
  • File packages/core/src/utils/__tests__/hitAreaUnreachableNeighbour.interaction.browser.spec.ts: clear.
  • File packages/core/src/utils/hitArea.test.ts: clear.
  • File packages/core/src/utils/hitArea.ts: clear, with one optional comment suggestion.

Automated review (maintainer link)

'@astryxdesign/core': patch
---

[fix] Under a finger, a tap on a control's grown touch area runs the control when the nearer neighbour is one that no tap can reach. Before, a neighbour inside an `inert` subtree, disabled, hidden by `visibility` or by skipped content, or with `pointer-events: none` counted as nearer, so every tap at that spot was swallowed. A neighbour that takes taps, including one drawn at opacity 0, still keeps a tap nearer it.

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 promises that any neighbour no tap can reach stops swallowing the tap, but takesTaps handles five states only: at this head a neighbour behind an open modal dialog, or one covered by the control's own panel, still swallows it. Suggested first sentence: "Under a finger, a tap on a control's grown touch area runs the control when the nearer neighbour is disabled, inside an inert subtree, hidden by visibility or skipped content, or has pointer-events: none." Then say that a neighbour behind an open modal dialog or under another element still keeps a tap nearer it, and match the title.

Comment on lines +720 to +722
* reaches is still the control's. Only the press asks: the measuring pass
* reads no style, so such a neighbour still stops a hit area halfway, which
* takes no tap from anyone. Opacity does not count: a control drawn at

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.

Optional (comment style): this sentence runs 26 words over three topics. Suggested: "Only the touch check asks. The measuring pass reads no style, so such a neighbour still stops a hit area halfway. That strip takes no tap from anyone."

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants