Repository navigation
fix(MultiSelector): guard disabled caller-rendered triggers - #11480
Conversation
|
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 | Visual · A11y · RTL |
|---|---|---|---|
| MultiSelector · Storybook | 101.2 kB (+82 B) · 17.7 kB CSS (0) | 2,718 (+5) | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 7.52 MB packed (+120 B); no new dependencies.
Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, so a maintainer needs to add the ci:run label for the required checks to run.
With renderTrigger, a disabled MultiSelector now keeps caller and ancestor handlers from running on click, Enter and Space, and the caller's control exposes aria-disabled, including under isReadOnly and a disabled InputGroup. Both new tests fail without the fix and pass with it, and a real-Chromium check of the same scenarios agrees. No public API changes.
Claims and files checked
- Verified: before the fix, a disabled caller-rendered trigger ran caller handlers and let clicks reach ancestors (both new tests fail on the base; in Chromium one click, Enter and Space gave 6 caller calls and 3 ancestor clicks).
- Verified: before the fix, the caller's control had no
aria-disabled. - Verified: the panel stays closed before and after the fix.
- Verified: the defect also occurred with
isReadOnlyset and with InputGroup disablement. - Verified: the custom-trigger branch spread the unfiltered caller props and composed the opening handlers while disabled.
- Verified: the fix reuses the filtered caller props and the shared disabled guard, and forwards the resolved
aria-disabled(MultiSelector.tsxlines 2549, 2581, 2602). - Verified: enabled behavior is unchanged (a click still opens the panel and runs
onClickonce; the full MultiSelector suite passes). - Verified: two regression cases are added to the existing disabled suite.
- Verified: one Core patch changeset, and no public API, wrapper, styling, consumer documentation or story is added (the generated API surface is unchanged).
- Verified: after the fix, caller and ancestor counts stay at zero and the control exposes
aria-disabled="true". - Verified: both regression cases fail on the base and pass with the fix.
- Verified: 267 tests pass across the five MultiSelector test files.
- Verified: ESLint and TypeScript pass on the changed files.
- Verified: the described Chromium click, Enter, Space, grouped-disablement and enabled-path results match an independent Chromium run.
- Verified: the cited component, read-only and focusable-disabled requirements say what the description says.
- Verified (changeset): the caller-rendered trigger exposes its disabled state and blocks caller handlers, including when read-only or disabled by InputGroup, while staying focusable.
.changeset/fix-multi-selector-custom-trigger-disabled.md: clearpackages/core/src/MultiSelector/MultiSelector.focusableDisabled.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clear
|
/approve-spec 68038e2 |
|
/approve-spec 6045844 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, so a maintainer needs to add the ci:run label for the required checks to run (the label takes effect on the next push, or a close and reopen).
With renderTrigger, a disabled MultiSelector now keeps caller and ancestor handlers from running on click, Enter and Space, and the caller's control exposes aria-disabled="true", including under isReadOnly and inside a disabled InputGroup. Both new tests fail without the fix and pass with it, and an independent Chromium run of the same scenarios agrees; the public API is unchanged.
Claims and files checked
- Verified: before the fix, a disabled caller-rendered trigger ran caller handlers and let clicks reach an ancestor (both new tests fail on the base; in Chromium one click, Enter and Space gave 6 caller calls and 3 ancestor clicks, directly disabled with read-only and disabled by InputGroup alike).
- Verified: before the fix, the caller's control had no
aria-disabled, and the panel stayed closed. - Verified: the custom-trigger branch spread the unfiltered caller props and composed the opening handlers while disabled.
- Verified: the fix reuses the filtered caller props and the shared disabled guard and forwards the resolved
aria-disabled(MultiSelector.tsxlines 2561, 2593, 2614). - Verified: after the fix, caller and ancestor counts stay at zero, focus stays on the control, the selection is unchanged, the panel stays closed, and the control exposes
aria-disabled="true". - Verified: enabled behavior is unchanged (a click opens the panel identically before and after, and the existing render-prop case that toggles an option calls
onChangeonce). - Verified: two regression cases join the existing disabled suite, and both fail on the base and pass with the fix.
- Verified: one Core patch changeset, and no public API, wrapper, styling, consumer documentation or story is added (the generated API surface is unchanged).
- Verified: 267 tests pass across the five MultiSelector test files, and ESLint and TypeScript pass.
- Verified: the cited component, read-only and focusable-disabled requirements say what the description says.
- Verified: the public text carries no internal context.
- Verified (changeset): the caller-rendered trigger exposes its disabled state and blocks caller handlers, including when read-only or disabled by InputGroup, while staying focusable.
.changeset/fix-multi-selector-custom-trigger-disabled.md: clearpackages/core/src/MultiSelector/MultiSelector.focusableDisabled.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clear
User impact
A disabled MultiSelector with
renderTriggerstill runs caller event handlers and lets clicks reach an ancestor. The custom control also lacksaria-disabled. The selection panel stays closed, but callbacks can still perform actions that the disabled control should block. This also occurs whenisReadOnlyis set or InputGroup supplies the disabled state.Problem and solution fit
The custom-trigger branch spreads the raw caller props and composes activation handlers even while disabled, bypassing the filtered props already used by the built-in trigger. It also omits the resolved disabled ARIA state.
Use the existing filtered caller props and disabled-interaction guards, and forward resolved
aria-disabled. Enabled handler composition and caller-owned rendering remain unchanged.Expected behavior and authority
MultiSelector FR8 and FR11 require the caller control to carry the component's behavior and disabled state without opening or reaching caller/ancestor handlers. AST-011 FR5 makes disabled behavior take precedence over read-only.
Smallest restoration
Evidence
aria-disabledis missing. The videos cover direct disabled + read-only and InputGroup-inherited disablement.aria-disabled="true". The selection remains unchanged and the panel stays closed.AS-IS
as-is.mp4
TO-BE
to-be.mp4
Scope
Components: MultiSelector
Testing
pnpm exec vitest run --project ui packages/core/src/MultiSelector --maxWorkers=1— 267 tests pass across five files.