Skip to content

[FIR-292] Rewrite ff-select on a portaled CDK overlay panel#52

Merged
mfg1986 merged 5 commits into
developfrom
feature/FIR-292_select-overlay
Jul 20, 2026
Merged

[FIR-292] Rewrite ff-select on a portaled CDK overlay panel#52
mfg1986 merged 5 commits into
developfrom
feature/FIR-292_select-overlay

Conversation

@mfg1986

@mfg1986 mfg1986 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What

Rewrites the ff-select primitive's options panel on CDK Overlay (portaled to body, connected to the trigger with bottom→top fallback, width-matched, reposition-on-scroll) and extends it — fully additively — with multi-selection (values/valuesChange), bindLabel/bindValue for arbitrary option objects, custom option/selected-label templates, and complete keyboard support (Home/End, typeahead), keeping the existing value/valueChange/CVA contract intact.

Why

FF-CAT-06 — the highest-risk P0 migration blocker: 87 hub-select usages in Flydocs, 9 of them appendTo body inside modals. Jira: FIR-292

Key decisions

  • Focus never enters the portaled panel: keyboard navigation drives aria-activedescendant on the local trigger/search control (WAI-ARIA listbox pattern), so a cdkTrapFocus ancestor (ff-dialog-container) never sees focus leave its subtree. Integration specs cover open/Escape inside a trapped dialog.
  • CDK's structural overlay CSS is shipped through the component stylesheet (global via ViewEncapsulation.None), z-index tokenized as var(--ff-sys-z-dropdown, 1000); consolidating it as a DS-level asset is tracked as debt.
  • select.contract.ts updated with the new inputs/outputs, template-slot clauses and keyboard/ARIA guarantees; SelectContract stays a primitive (inventory unchanged).

How to verify

  • pnpm nx run-many -t build lint test -p design-system design-system-contract playground — design-system 490 ✓ (55 select specs) · contract 13 ✓ · lint 0 err.
  • Catalog /catalog/select: basic, searchable, multi, bindLabel/bindValue, custom templates, and the "inside a modal" demo (panel stacks above the dialog, focus stays trapped). Visual smoke audited: console/network clean.

mfg1986 added 5 commits July 18, 2026 16:50
Replace the local position:absolute dropdown with a CDK-overlay panel
connected to the trigger (bottom/top fallback, width matched, closes on
outside pointer events and repositions on scroll), so it renders above
any clipping ancestor such as a modal. Focus is kept on the local
trigger/search at all times (never on the portaled options), using
aria-activedescendant to track the active option, so the panel does not
fight a surrounding cdkTrapFocus. Adds multi-selection (checkboxes,
values/valuesChange), bindLabel/bindValue for arbitrary option objects,
custom option/selected-label templates, Home/End and typeahead
keyboard support. The existing value/valueChange and CVA contract stay
unchanged for single-selection callers.
…plates

Document the additive inputs/outputs (values, multiple, bindLabel,
bindValue, valuesChange), the option/label template slots, and the
expanded keyboard/aria guarantees (Home/End, typeahead, activedescendant,
aria-multiselectable) without touching the primitive/pattern inventory
counts.
…lect catalog

Cover the new ff-select capabilities in the playground: multi-selection,
bindLabel/bindValue against a plain object array, custom option/label
templates, and a searchable select hosted inside an AlertService
custom dialog to demonstrate the overlay panel working inside a
cdkTrapFocus-guarded ff-dialog-container.
@mfg1986

mfg1986 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

✅ Verdict: APPROVED (reviewer: mgarcia). All five acceptance criteria met: portaled CDK overlay with correct positioning and close behaviour inside ff-dialog (focus stays trapped via aria-activedescendant), option/label templates + multi-selection + search on top of an unchanged CVA and public API, full keyboard and listbox ARIA, contract + catalog + specs. Doctrine review found no blockers; the CDK overlay CSS consolidation is tracked as FIR-315. Base was 7 commits behind (FIR-288's merge) and both PRs touch the design-system barrel — branch updated by merging develop into the head and CI re-ran green on the updated head. Merging to develop.

@mfg1986
mfg1986 merged commit c09287c into develop Jul 20, 2026
4 checks passed
@mfg1986
mfg1986 deleted the feature/FIR-292_select-overlay branch July 20, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant