Skip to main content
cngx-src documentation

createOverflowPopoverHighlightSync

Functioncommon/tabs/overflowWCAG AA

projects/common/tabs/overflow/overflow-template-cascade.ts

Description#

Resets the AD highlight on popover close.
Keyboard-open paths (ArrowDown / End / typeahead on the closed trigger) set activeIndex via AD's own keydown listener before opening - unaffected. Mouse-open leaves activeIndex === -1 so the popover renders unhighlighted.
Without this reset, the next open would inherit a stale index from the prior keyboard session.

Must run in injection context.

UX / a11y

  • Closing the popover resets the highlight, so a keyboard session never leaves a stale aria-activedescendant for the next open.
  • Each row has a stable descendant id (tabOverflowOptionId), so the SR focus reference never dangles across re-renders.
  • Highlight is virtual focus, not DOM focus: keyboard nav moves aria-activedescendant while real focus stays on the trigger (APG menu-button); the rows are never tab stops.

Signature#

createOverflowPopoverHighlightSync(popover: Signal, ad: Signal)

Parameters#

@parampopoverSignal
@paramadSignal

Returns#

void