Repository navigation
fix(core): keep disabled selectors closed on default open - #11488
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 |
|---|---|---|---|
| Selector | 109.8 kB (+1 B) · 18.4 kB CSS (0) | — | ✗ · ✓ · ✓ |
| SelectorOption | 21.6 kB (0) · 6.4 kB CSS (0) | — | ✗ · ✓ · ✓ |
| PowerSearch | 306.1 kB (+6 B) · 25.3 kB CSS (0) | — | — · — · — |
3 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Pagination | 120.9 kB (+2 B) · 18.8 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 298.3 kB (+2 B) · 454 B CSS (0) | — | — · — · — |
| MultiSelector · Storybook | 101.2 kB (0) · 17.7 kB CSS (0) | 2,718 (0) | ✓ · ✓ · ✓ |
Visual changes: 4 snapshots in 1 component
A change is a question for the reviewer, not a failure.
Package size: @astryxdesign/core 7.52 MB packed (+14 B); no new dependencies.
Touched components checked; add ci:run-visual 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. A maintainer adds the ci:run label so CI runs.
The fix keeps a disabled Selector or MultiSelector closed when it mounts with isDefaultOpen, including when it is also read-only or disabled by an InputGroup, which matches the rule that a disabled control never opens a surface or fires a callback. The new unit and Chromium cases fail without the guard and pass with it, so nothing else is needed from you.
Claims and files checked
- Changeset: both components stay closed when mounted disabled with
isDefaultOpen, read-only and group-disabled included. Verified: the unit and Chromium cases fail on the base and pass on this head. - Before the fix, a disabled default-open field opens and reports itself expanded. Verified:
aria-expanded="true"on the base. - The old guard only excluded effective read-only, which is false whenever the field is disabled. Verified in both components.
- Both mount Effects now check the resolved disabled state, group included, before opening or calling
onOpenChange. Verified. - The Effects stay mount-only, so enabling a blocked field later does not open it. Verified by the no-retry cases.
- Enabled default-open and ordinary selection are unchanged. Verified by the enabled cases and the full Selector and MultiSelector suites (621 tests).
- The cited disabled-control and read-only records say what the description quotes. Verified.
- Scope: one guard per component, three unit cases each, two Chromium cases, one patch changeset, and no API, docs, record or story change. Verified; the public API surface is unchanged.
- The Chromium cases keep the disabled trigger's Tab stop and catch any native popover or dialog opening. Verified: 3 passed on this head, and both new cases fail on the base.
- Lint, formatting and type checks pass on the changed files. Verified.
- The recordings' selection and
onChangereadouts were not judged; the existing selection tests pass. - Files:
.changeset/quiet-selectors-default-open.md,Selector.tsx,MultiSelector.tsx,Selector.test.tsx,MultiSelector.test.tsxandSelector.a11y.chromium.spec.ts: clear.
|
/approve-spec b09c13f |
|
/approve-spec c7ba07e |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. A maintainer adds the ci:run label so CI runs.
The guard keeps a disabled Selector or MultiSelector closed when it mounts with isDefaultOpen, including when it is also read-only or disabled by an InputGroup, as the rule that a disabled control never opens a surface or fires a callback requires. The new unit and Chromium cases fail without the guard and pass with it, so nothing else is needed from you.
Claims and files checked
- Changeset: both components keep their surfaces closed when mounted disabled with
isDefaultOpen, read-only and group-disabled included. Verified: the unit and Chromium cases and browser probes fail on the base and pass on this head, and plainisDisabledbehaves the same. - Before the fix, a disabled default-open field opens and reports itself expanded. Verified on the base:
aria-expanded="true"with an open list or modal sheet. - The old guard only excluded effective read-only, which is false whenever the field is disabled. Verified in both components.
- Both mount Effects now check the resolved disabled state, group included, before any surface callback or native opening. Verified:
onOpenChangeis not called and noshowPopoverorshowModalcall is recorded. - The Effects stay mount-only, so enabling a blocked field later does not open it. Verified by the no-retry cases.
- Enabled default-open and ordinary selection are unchanged. Verified by the enabled cases, an identical enabled frame, and the full Selector and MultiSelector suites (621 tests).
- The cited disabled-control and read-only rules say what the description states. Verified.
- Scope: one guard per component, three unit cases each, two Chromium cases in the existing spec routed for both components, one patch changeset, and no API, style, docs, spec or story change. Verified; the public API surface is unchanged.
- The Chromium cases keep the disabled trigger's Tab stop and catch any native opening. Verified: 3 passed on this head, and both new cases fail on the base.
- Regression proof: with the base guard the four disabled and group cases fail while the two enabled cases pass. Verified.
- The recordings' setup is stated in text and was not judged from the clips; what they show, a disabled mount staying closed and a pick calling
onChangeonce, is covered by the new cases and the existing selection tests. - Lint, formatting and type checks pass. Verified for the changed files; the repository-wide runs are left to CI.
- Files:
.changeset/quiet-selectors-default-open.md,Selector.tsx,MultiSelector.tsx,Selector.test.tsx,MultiSelector.test.tsxandSelector.a11y.chromium.spec.ts: clear.
|
/approve-spec 742b429 |
There was a problem hiding this comment.
Approved pending CI: the required checks are still finishing on this head.
The guard keeps a disabled Selector or MultiSelector closed when it mounts with isDefaultOpen, including when it is also read-only or disabled by an InputGroup, as the rule that a disabled control never opens a surface or fires a callback requires. The new unit and Chromium cases fail without the guard and pass with it, so nothing else is needed from you.
Claims and files checked
- Changeset: both components keep their surfaces closed when mounted disabled with
isDefaultOpen, read-only and group-disabled included. Verified: the unit cases, the Chromium cases and browser probes fail on the base and pass on this head, and plainisDisabledbehaves the same. - Before the fix, a disabled default-open field opens and reports itself expanded. Verified on the base:
aria-expanded="true"with an open list or modal sheet, and MultiSelector reports an open throughonOpenChange. - The old guard only excluded effective read-only, which is false whenever the field is disabled. Verified in both components.
- Both mount Effects now check the resolved disabled state, group included, before any surface callback or native opening. Verified:
onOpenChangeis not called and noshowPopoverorshowModalcall happens. - The Effects stay mount-only, so enabling a blocked field later does not open it. Verified by the no-retry cases.
- Enabled default-open and ordinary selection are unchanged. Verified by the enabled cases, an identical enabled frame, and the full Selector and MultiSelector suites (623 tests at this head, after the base merges).
- The cited disabled-control and read-only rules say what the description states. Verified.
- Scope: one guard per component, three unit cases each, two Chromium cases in the existing spec routed for both components, one patch changeset, and no API, style, docs, spec or story change. Verified; the public API surface is unchanged.
- The Chromium cases keep the disabled trigger's Tab stop and catch any native opening. Verified: 3 passed on this head.
- Regression proof: with the base guard the four disabled and group cases fail while the two enabled cases pass. Verified.
- The recordings' setup is stated in text and was not judged from the clips; what they show is covered by the new cases and the existing selection tests.
- Lint, formatting and type checks pass. Verified by CI's lint and typecheck on this head.
- Files:
.changeset/quiet-selectors-default-open.md,Selector.tsx,MultiSelector.tsx,Selector.test.tsx,MultiSelector.test.tsxandSelector.a11y.chromium.spec.ts: clear.












User impact
A disabled Selector or MultiSelector can open its selection surface as soon as it mounts with
isDefaultOpen. This also occurs whenisReadOnlyis set or disablement comes from an InputGroup. The field appears unavailable but exposes choices and reports itself expanded without the person activating it.Problem and solution fit
The mount-only Effect checks
!isEffectivelyReadOnly, but that state isisReadOnly && !isDisabled. Disabled controls therefore pass the initial-opening check, including when both availability props are true.Both Effects now check resolved
isDisabledbefore opening. This includes InputGroup disablement and rejects the opening before surface callbacks or native presentation. The Effects remain mount-only: enabling a previously blocked field does not invent a later default opening. Enabled default-open and ordinary selection retain their existing paths.Expected behavior and authority
Current AST-085 FR2 and FR7 prohibit a disabled control from opening a surface or invoking a callback, including group-disabled members. AST-011 FR2 and FR5 exclude default opening while read-only and give disabled behavior precedence when both states are set. The fix applies the existing disabled availability rule to the initial-opening path.
Smallest restoration
it.eachor combination matrix.No public prop, presentation default, styling, consumer documentation, specification, or shipped story is changed. Recording fixtures and media remain outside the implementation branch.
Evidence
aria-expanded="true"without activating the field.onChangeonce. A blocked InputGroup field remains closed when enabled later.Both recordings use the same real components, neutral light theme, data, 1100 × 800 viewport, and Chromium 149. The disabled step mounts the field through a recording-only control; it does not click or activate the field. Readouts come from the trigger's actual ARIA state and real
onChangecallbacks. AS-IS loads the base modules from4d1cb828f6; TO-BE loads the exact source tree committed asb09c13fa07. The videos show the popover presentation; the browser regressions additionally cover blocked native sheet opening.AS-IS
default-open-as-is.mp4
TO-BE
default-open-to-be.mp4
Scope
Components: Selector, MultiSelector
General open-surface lifecycle, custom-trigger read-only semantics, and unrelated disabled handlers are outside this change.
Testing
pnpm exec vitest run --project ui --maxWorkers=2 packages/core/src/Selector packages/core/src/MultiSelector— 621 tests passed across 20 files.pnpm exec playwright test packages/core/src/Selector/__tests__/Selector.a11y.chromium.spec.ts --config=playwright.config.ts --project=chromium— 3 tests passed, including the existing naming regression.pnpm check:repo, passed.pnpm lint:strict— repository checks passed; 0 errors and 237 warnings.