Repository navigation
fix(core): a tap is not swallowed beside a disabled, inert or hidden neighbour - #13009
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🔎 Preview ·
|
| Component | Size | LoC |
|---|---|---|
| lab/CommentComposer | 185.3 kB (+191 B) · 1.9 kB CSS (0) | — |
| Switch | 110.9 kB (+177 B) · 10.4 kB CSS (0) | — |
| Typeahead | 93.8 kB (+177 B) · 14.1 kB CSS (0) | — |
105 more components
| Component | Size | LoC |
|---|---|---|
| richtext/RichTextEditor | 310.5 kB (+177 B) · 2.7 kB CSS (0) | — |
| MobileNavToggle | 67.7 kB (+176 B) · 11.1 kB CSS (0) | — |
| ListItem | 80.9 kB (+173 B) · 12.5 kB CSS (0) | — |
| Pagination | 152.2 kB (+173 B) · 19.8 kB CSS (0) | — |
| PowerSearch | 317.0 kB (+172 B) · 27.1 kB CSS (0) | — |
| Thumbnail | 71.8 kB (+169 B) · 12.7 kB CSS (0) | — |
| TimeInput | 179.8 kB (+169 B) · 17.6 kB CSS (0) | — |
| lab/TourStep | 96.5 kB (+169 B) · 691 B CSS (0) | — |
| CheckboxListItem | 81.8 kB (+168 B) · 12.5 kB CSS (0) | — |
| Carousel | 77.5 kB (+167 B) · 12.1 kB CSS (0) | — |
| DialogHeader | 70.7 kB (+167 B) · 12.8 kB CSS (0) | — |
| Field | 60.8 kB (+167 B) · 7.6 kB CSS (0) | — |
| InputGroup | 63.0 kB (+167 B) · 8.8 kB CSS (0) | — |
| Lightbox | 151.0 kB (+167 B) · 12.3 kB CSS (0) | — |
| lab/CommentThread | 380.2 kB (+167 B) · 2.4 kB CSS (0) | — |
| Button | 67.4 kB (+166 B) · 11.1 kB CSS (0) | — |
| DateInput | 207.0 kB (+165 B) · 18.7 kB CSS (0) | — |
| RadioList | 62.3 kB (+165 B) · 7.6 kB CSS (0) | — |
| lab/TransferList | 138.6 kB (+165 B) · 1.2 kB CSS (0) | — |
| richtext/RichTextEditorToolbar | 314.1 kB (+165 B) · 454 B CSS (0) | — |
| SideNavHeading | 87.1 kB (+164 B) · 12.5 kB CSS (0) | — |
| lab/Comments | 387.2 kB (+164 B) · 2.5 kB CSS (0) | — |
| CodeBlock | 83.5 kB (+163 B) · 12.9 kB CSS (0) | — |
| RadioListItem | 77.8 kB (+163 B) · 11.1 kB CSS (0) | — |
| Slider | 116.0 kB (+163 B) · 9.2 kB CSS (0) | — |
| Popover | 103.5 kB (+162 B) · 15.5 kB CSS (0) | — |
| Toast | 107.1 kB (+162 B) · 11.5 kB CSS (0) | — |
| DateRangeInput | 105.0 kB (+161 B) · 13.9 kB CSS (0) | — |
| ChatComposerTokenElement | 87.0 kB (+159 B) · 12.5 kB CSS (0) | — |
| ChatDictationButton | 68.0 kB (+159 B) · 11.2 kB CSS (0) | — |
| ChatSendButton | 67.8 kB (+159 B) · 11.1 kB CSS (0) | — |
| TextInput | 100.7 kB (+159 B) · 12.6 kB CSS (0) | — |
| lab/DialogHeroHeader | 91.9 kB (+159 B) · 372 B CSS (0) | — |
| lab/SelectableCardGroup | 71.2 kB (+159 B) · 162 B CSS (0) | — |
| ChatComposerInput | 87.0 kB (+158 B) · 12.5 kB CSS (0) | — |
| CheckboxInput | 70.8 kB (+158 B) · 10.6 kB CSS (0) | — |
| DrawerHeader | 70.8 kB (+158 B) · 14.3 kB CSS (0) | — |
| SideNavItem | 81.5 kB (+158 B) · 12.3 kB CSS (0) | — |
| Stepper | 69.2 kB (+158 B) · 11.3 kB CSS (0) | — |
| richtext/RichTextView | 287.3 kB (+158 B) · 2.4 kB CSS (0) | — |
| IconButton | 67.4 kB (+157 B) · 11.1 kB CSS (0) | — |
| InfoTip | 51.7 kB (+157 B) · 5.7 kB CSS (0) | — |
| Table | 123.9 kB (+157 B) · 21.1 kB CSS (0) | — |
| TextArea | 94.4 kB (+157 B) · 10.0 kB CSS (0) | — |
| ChatComposer | 89.9 kB (+156 B) · 13.5 kB CSS (0) | — |
| DateTimeInput | 230.9 kB (+156 B) · 20.4 kB CSS (0) | — |
| ToggleButton | 94.7 kB (+156 B) · 11.3 kB CSS (0) | — |
| TopNavMenu | 86.3 kB (+156 B) · 12.4 kB CSS (0) | — |
| lab/DiffViewer | 95.6 kB (+156 B) · 2.1 kB CSS (0) | — |
| lab/VideoPlayer | 235.4 kB (+156 B) · 2.1 kB CSS (0) | — |
| TopNavMegaMenu | 80.9 kB (+154 B) · 13.0 kB CSS (0) | — |
| lab/ListInput | 96.9 kB (+154 B) · 922 B CSS (0) | — |
| Banner | 69.5 kB (+153 B) · 11.6 kB CSS (0) | — |
| ContextMenu | 104.9 kB (+153 B) · 19.6 kB CSS (0) | — |
| DropdownMenu | 112.4 kB (+153 B) · 19.8 kB CSS (0) | — |
| lab/MediaPlaybackRate | 227.2 kB (+153 B) · 1.5 kB CSS (0) | — |
| lab/MediaTime | 227.2 kB (+153 B) · 1.5 kB CSS (0) | — |
| lab/MediaVolume | 227.2 kB (+153 B) · 1.5 kB CSS (0) | — |
| ComplexSelector | 82.8 kB (+152 B) · 13.2 kB CSS (0) | — |
| FileInput | 76.9 kB (+152 B) · 12.6 kB CSS (0) | — |
| TableSelectionToolbar | 77.9 kB (+152 B) · 14.5 kB CSS (0) | — |
| lab/MediaCaptionsButton | 227.2 kB (+152 B) · 1.5 kB CSS (0) | — |
| lab/MediaFullscreenButton | 227.2 kB (+152 B) · 1.5 kB CSS (0) | — |
| lab/MediaPlayButton | 227.2 kB (+152 B) · 1.5 kB CSS (0) | — |
| lab/MediaSeekButton | 227.2 kB (+152 B) · 1.5 kB CSS (0) | — |
| lab/MediaTimeSlider | 227.2 kB (+152 B) · 1.5 kB CSS (0) | — |
| Calendar | 78.6 kB (+151 B) · 11.8 kB CSS (0) | — |
| FieldLabel | 56.7 kB (+151 B) · 6.1 kB CSS (0) | — |
| BaseTypeahead | 83.1 kB (+150 B) · 12.1 kB CSS (0) | — |
| TabMenu | 83.3 kB (+150 B) · 12.3 kB CSS (0) | — |
| lab/AudioPlayer | 237.0 kB (+150 B) · 1.8 kB CSS (0) | — |
| Markdown | 208.2 kB (+148 B) · 23.4 kB CSS (0) | — |
| MoreMenu | 112.7 kB (+148 B) · 19.8 kB CSS (0) | — |
| ToggleButtonGroup | 42.0 kB (+148 B) · 3.7 kB CSS (0) | — |
| AlertDialog | 132.9 kB (+147 B) · 16.2 kB CSS (0) | — |
| MultiSelector | 107.8 kB (+147 B) · 18.7 kB CSS (0) | — |
| TableCell | 106.1 kB (+147 B) · 20.1 kB CSS (0) | — |
| ChatLayout | 91.0 kB (+146 B) · 11.7 kB CSS (0) | — |
| NumberInput | 105.7 kB (+146 B) · 12.8 kB CSS (0) | — |
| SegmentedControlItem | 19.2 kB (+146 B) · 4.3 kB CSS (0) | — |
| lab/ChatEmojiPicker | 126.7 kB (+146 B) · 773 B CSS (0) | — |
| lab/ChatReactionBar | 127.9 kB (+146 B) · 1.1 kB CSS (0) | — |
| ButtonGroup | 44.7 kB (+145 B) · 3.7 kB CSS (0) | — |
| SideNavCollapseButton | 68.3 kB (+145 B) · 11.2 kB CSS (0) | — |
| Selector | 119.2 kB (+144 B) · 19.4 kB CSS (0) | — |
| lab/Schedule | 117.4 kB (+144 B) · 3.9 kB CSS (0) | — |
| TableHeaderCell | 105.9 kB (+142 B) · 20.0 kB CSS (0) | — |
| BreadcrumbItem | 101.7 kB (+141 B) · 14.0 kB CSS (0) | — |
| ChatLayoutScrollButton | 68.0 kB (+140 B) · 11.3 kB CSS (0) | — |
| lab/PageControl | 78.9 kB (+139 B) · 709 B CSS (0) | — |
| lab/TransferListSelector | 150.0 kB (+137 B) · 1.4 kB CSS (0) | — |
| lab/TabBarMoreList | 103.9 kB (+136 B) · 1.8 kB CSS (0) | — |
| AppShell | 100.6 kB (+135 B) · 14.9 kB CSS (0) | — |
| TopNavHeading | 86.8 kB (+132 B) · 12.4 kB CSS (0) | — |
| CheckboxList | 74.5 kB (+131 B) · 8.1 kB CSS (0) | — |
| lab/EmojiPicker | 120.5 kB (+130 B) · 751 B CSS (0) | — |
| MobileNav | 78.9 kB (+129 B) · 11.8 kB CSS (0) | — |
| TopNav | 80.8 kB (+127 B) · 12.1 kB CSS (0) | — |
| SideNav | 123.8 kB (+126 B) · 12.5 kB CSS (0) | — |
| Tokenizer | 111.8 kB (+125 B) · 21.7 kB CSS (0) | — |
| SegmentedControl | 103.3 kB (0) · 7.2 kB CSS (0) | — |
| Timestamp | 31.2 kB (0) · 11.4 kB CSS (0) | — |
| lab/TabBarItem | 3.9 kB (0) · 1.8 kB CSS (0) | — |
| OverflowList | 12.6 kB (−1 B) · 3.7 kB CSS (0) | — |
| lab/TabBar | 84.4 kB (−2 B) · 1.8 kB CSS (0) | — |
Package size: @astryxdesign/core 7.86 MB packed (+857 B); no new dependencies.
Not run on this PR: add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
|
/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).
The earlier inline notes on the changeset and on the takesTaps comment still apply at this head; the comment-style one is optional.
Claims and files checked
Review mode: same-head; reason: none
- 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 targets the control but its click handler never runs: verified (the 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 left out because the 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 avoid these lines, 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.
- 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.
The release note names the five states the check handles: disabled, inside an inert subtree, hidden by visibility or by skipped content, and pointer-events: none. It also says that a neighbour under another element, or behind an open modal dialog, still keeps a tap nearer it. The check's comment is split into short sentences.
|
/approve-spec bb90ef4 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, and it starts once the pull request is marked ready for review.
The release note, the description and the size report now match what the change does: in a real browser, a finger's tap beside a disabled or inert neighbour runs the control, and a neighbour that takes taps still keeps it. One optional comment-style note sits inline on hitArea.ts.
Claims and files checked
Review mode: incremental; reason: none
- Changeset, a tap on a grown touch area runs the control beside a disabled, inert, visibility-hidden, skipped-content or pointer-events-none neighbour: verified (unit and browser tests; real-touch fixture taps).
- Changeset, before the fix such a neighbour swallowed every tap at that spot: verified (the new tests fail on the base, 0 row clicks).
- Changeset, a neighbour that takes taps, even at opacity 0, still keeps a tap nearer it: verified (unit and browser tests; enabled-neighbour fixture).
- Changeset, so does a neighbour under another element or behind an open modal dialog: verified (a covered neighbour still swallows on the head; the check reads no modal or occlusion state,
hitArea.ts:726-758). - Description, the browser targets the visible control but its click handler never runs: verified (the hit test returns the row; 0 clicks on the base).
- Description, the reported 20 px row grows 12 px and its pager sits in an inert, skipped subtree with the press inside its box: verified as a scenario (a fixture with that geometry swallows on the base and runs the row on the head).
- Description, the press check skips disabled, inert, pointer-events-none and checkVisibility-hidden neighbours, with a style fallback: verified (
hitArea.ts:726-758). - Description, the check runs only for a neighbour already nearer, and the measuring pass reads no style and grows the same: verified (
hitArea.ts:1149-1152; unit test). - Description, opacity is left out because Core's checkbox, switch and radio inputs take taps at opacity 0: verified (
CheckboxInput.tsx:167,Switch.tsx:324,RadioListItem.tsx:99). - Description, content under another element or behind an open modal dialog is not covered: verified.
- Description, the two named open pull requests that edit the candidate read avoid these lines, and the named draft conflicts in two hunks: verified (the two merge cleanly; the draft has two conflict blocks in
hitArea.ts, plus one in its test). - Description, six new unit cases fail before, 83 pass after, and three unchanged-path cases pass on both: verified.
- Description, the browser spec fails 5 of 6 before and passes 30 of 30 after, in Chromium and WebKit: verified in Chromium; WebKit could not run in this review.
- Description, the spec's neighbour starts 2 px below the press, so the browser's hit test picks the row: verified (spec geometry; hit test).
- Description, first-load gzip grows +0 B on docs, +169 B on form, +150 B on menu and +149 B on table: verified for docs, form and menu; table measures +147 B here.
- Description, no new public API, default or interaction model, and no internal context: verified (API surface build: no rows).
- File
.changeset/hit-area-unreachable-neighbour.md: clear. - 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-style note.
| if (typeof element.checkVisibility === 'function') { | ||
| return element.checkVisibility({checkVisibilityCSS: true}); | ||
| } | ||
| // Without `checkVisibility`, its two checks are read from the styles. |
There was a problem hiding this comment.
Optional (comment style, missed in the earlier review): this sentence is in the passive voice, and the repository's comment style asks for active voice. Suggested: "Without checkVisibility, the computed styles give its two checks."
|
/approve-spec 26e32ad |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, and it starts once the pull request is marked ready for review.
The merge of main leaves the fix unchanged: in a real browser, a finger's tap beside a disabled or inert neighbour still runs the control, and a neighbour that takes taps still keeps it. The optional comment-style note on hitArea.ts still applies.
Claims and files checked
Review mode: incremental; reason: none
- Changeset, a tap on a grown touch area runs the control beside a disabled, inert, visibility-hidden, skipped-content or pointer-events-none neighbour: verified (unit and browser tests at this head; real-touch fixture taps).
- Changeset, before the fix such a neighbour swallowed every tap at that spot: verified (the new tests fail on the base, 0 row clicks).
- Changeset, a neighbour that takes taps, even at opacity 0, still keeps a tap nearer it: verified (unit and browser tests; enabled-neighbour fixture).
- Changeset, so does a neighbour under another element or behind an open modal dialog: verified (a covered neighbour still swallows on the head; the check reads no modal or occlusion state,
hitArea.ts:726-758). - Description, the browser targets the visible control but its click handler never runs: verified (the hit test returns the row; 0 clicks on the base).
- Description, the reported 20 px row grows 12 px and its pager sits in an inert, skipped subtree with the press inside its box: verified as a scenario (a fixture with that geometry swallows on the base and runs the row on the head).
- Description, the press check skips disabled, inert, pointer-events-none and checkVisibility-hidden neighbours, with a style fallback: verified (
hitArea.ts:726-758). - Description, the check runs only for a neighbour already nearer, and the measuring pass reads no style and grows the same: verified (
hitArea.ts:1149-1152; unit test). - Description, opacity is left out because Core's checkbox, switch and radio inputs take taps at opacity 0: verified (
CheckboxInput.tsx:167,Switch.tsx:324,RadioListItem.tsx:99). - Description, content under another element or behind an open modal dialog is not covered: verified.
- Description, the two named open pull requests that edit the candidate read avoid these lines, and the named draft conflicts in two hunks: verified (the two merge cleanly with this head; the draft has two conflict blocks in
hitArea.ts, plus one in its test). - Description, six new unit cases fail before, 83 pass after, and three unchanged-path cases pass on both: verified at this head.
- Description, the browser spec fails 5 of 6 before and passes 30 of 30 after, in Chromium and WebKit: verified in Chromium; WebKit could not run in this review.
- Description, the spec's neighbour starts 2 px below the press, so the browser's hit test picks the row: verified (spec geometry; hit test).
- Description, first-load gzip grows +0 B on docs, +169 B on form, +150 B on menu and +149 B on table against an earlier
main: consistent (against the merged base this head measures +0, +175, +152 and +151 B, all under 0.2 KB). - Description, no new public API, default or interaction model, and no internal context: verified (API surface build: no rows).
- File
.changeset/hit-area-unreachable-neighbour.md: clear. - 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-style note.
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 reported 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 lies inside the pager's box. 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 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.pnpm size:pagesagainst main 489b468: first-load gzip grows +0 B on docs, +169 B on form, +150 B on menu, +149 B on table. This is a report for a defect repair in a shared module, asarchitecture:component-import-boundariesINV10 asks.