Skip to content

fix(MultiSelector): guard disabled caller-rendered triggers - #11480

Merged
cixzhang merged 2 commits into
meta:mainfrom
korkt-kim:korkt-kim/ast011-custom-trigger-disabled
Nov 13, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
korkt-kim:korkt-kim/ast011-custom-trigger-disabled

Conversation

@korkt-kim

Copy link
Copy Markdown
Contributor

User impact

A disabled MultiSelector with renderTrigger still runs caller event handlers and lets clicks reach an ancestor. The custom control also lacks aria-disabled. The selection panel stays closed, but callbacks can still perform actions that the disabled control should block. This also occurs when isReadOnly is 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

  • Reuse disabled filtering and guards in the custom-trigger branch.
  • Add two explicit regression cases to the existing disabled suite: event suppression with read-only, and InputGroup-resolved ARIA overriding caller ARIA.
  • Add one Core fix Changeset. No public API, component wrapper, styling, consumer documentation, or shipped story is added.

Evidence

  • Reproduction before the change: clicking, pressing Enter, and pressing Space reaches caller and ancestor handlers while disabled; aria-disabled is missing. The videos cover direct disabled + read-only and InputGroup-inherited disablement.
  • Result after the change: caller and ancestor counts remain zero, and the control exposes aria-disabled="true". The selection remains unchanged and the panel stays closed.
  • Representative unchanged path: re-enabling opens the panel and selecting Banana changes the value once in both versions.
  • Regression proof: both retained cases reproduce the original defect against the base implementation and pass with this fix.

AS-IS

as-is.mp4

TO-BE

to-be.mp4

Scope

Components: MultiSelector

  • 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 --project ui packages/core/src/MultiSelector --maxWorkers=1 — 267 tests pass across five files.
  • Targeted strict ESLint and TypeScript checks pass.
  • Chromium 149: real pointer click, Enter, Space, grouped disablement, and enabled recovery against the base and proposed implementations.

@vercel

vercel Bot commented Nov 13, 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 13, 2026 4:02pm UTC

Request Review

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

astracat-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 13, 2026, 4:21 PM UTC

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 6045844

Storybook · Sandbox · built from this PR's head

Modified components

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

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

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 isReadOnly set 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.tsx lines 2549, 2581, 2602).
  • Verified: enabled behavior is unchanged (a click still opens the panel and runs onClick once; 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: clear
  • packages/core/src/MultiSelector/MultiSelector.focusableDisabled.test.tsx: clear
  • packages/core/src/MultiSelector/MultiSelector.tsx: clear

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 68038e2

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 6045844

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 13, 2026

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

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.tsx lines 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 onChange once).
  • 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: clear
  • packages/core/src/MultiSelector/MultiSelector.focusableDisabled.test.tsx: clear
  • packages/core/src/MultiSelector/MultiSelector.tsx: clear

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as draft November 13, 2026 16:38
@cixzhang
cixzhang marked this pull request as ready for review November 13, 2026 16:39
@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Nov 13, 2026
@cixzhang
cixzhang merged commit 0a765b3 into meta:main Nov 13, 2026
136 of 140 checks passed
@github-actions
github-actions Bot deleted the korkt-kim/ast011-custom-trigger-disabled branch November 14, 2026 12:35

This branch was successfully deployed

1 active deployment
Preview — 6045844a Deployed Nov 13, 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) CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants