Repository navigation
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
|
/approve-spec 1339e47 |
There was a problem hiding this comment.
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
takesTapshandles (disabled, inside aninertsubtree, hidden byvisibilityor 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 (
PRESSy is 123 and.spotstarts at 125), so please correct the figure. hitArea.tsis a shared module, so the description needs its first-load gzip delta on the four reference pages frompnpm 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 inhitArea.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.
| '@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. |
There was a problem hiding this comment.
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.
| * 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 |
There was a problem hiding this comment.
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."
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
inertsubtree withcontent-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
The press check now skips a neighbour that is disabled, in an
inertsubtree, haspointer-events: none, or failscheckVisibility({checkVisibilityCSS: true}). Without that method, it readsvisibilityand an ancestor'scontent-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
takesTapscheck, asked only at the press about a neighbour already nearer than the control.readCandidates; this change avoids their lines. Draft refactor(core): touch hit areas are checked at press, not watched (AST-094 FR42) #11205 conflicts in two hunks.Evidence
Scope
Components: touch hit area (
utils/hitArea.ts)Testing
hitArea.test.tsandtouchHitArea.test.tsx.