CngxListboxTrigger
projects/common/interactive/listbox/listbox-trigger.directive.ts
Import#
import { CngxListboxTrigger } from '@cngx/common/interactive'
Description#
Trigger atom for listbox dropdowns.
Pairs a focusable element (button) with a CngxListbox and a CngxPopover
through explicit template references - no ancestor injection, consistent
with the CngxSortHeader / CngxSortRef orthogonal composition pattern.
Implements the WAI-ARIA combobox-less listbox trigger keyboard model:
| State | Key | Action |
|---|---|---|
| closed | Enter / Space / ArrowDown | open + highlight first enabled |
| closed | ArrowUp | open + highlight last enabled |
| open | ArrowDown / ArrowUp / Home / End | delegate to AD primitives |
| open | Enter / Space | activate; close if closeOnSelect() |
| any | Escape | close and restore focus to trigger |
Metadata#
Host#
Relationships
Used by11
Index#
Methods
Outputs
Derived State
HostBindings
HostListeners
Inputs#
CngxListboxListbox controlled by this trigger.
{ alias: 'cngxListboxTrigger' }Outputs#
Fires when the user presses Backspace on an empty input. Only
emitted when the host element is an <input> with a co-located
CngxListboxSearch - the tag-input convention "Backspace on empty
deletes the trailing chip" lives at the trigger, so consumers only
wire one subscription to own the delete path. On non-input hosts
(classic button triggers) the event never fires.
Methods#
HostBindings#
| Binding | Expression |
|---|---|
[attr.aria-haspopup] | "listbox" |
[attr.aria-expanded] | isOpen() |
HostListeners#
| Event | Handler |
|---|---|
(keydown) | keydown() |