Skip to main content
cngx-src documentation

createChipStripRoving

Functioncommon/interactive/reorderv0.1.0

projects/common/interactive/reorder/chip-strip-roving.ts

Description#

Plain factory for the chip-strip roving-tabindex controller shared by CngxReorderableMultiSelect today and by any future reorder-aware chip trigger (e.g. a tag-input with user-defined ordering). Extracted from the component so the same focus-state machine doesn't reappear inline in every variant.

Why not CngxRovingTabindex. That directive uses a host (keydown) listener that doesn't check modifier keys. Co-located with CngxReorder on the same chip-strip element it double-fires on Ctrl+Arrow (the reorder emits, then roving also moves focus - racy). This controller deliberately skips modifier-pressed events so the paired reorder directive owns that gesture.

Injection context. Must be called in an injection context (component constructor / field init) because it installs an * effect() for the active-index clamp on count shrink.

Signature#

createChipStripRoving(opts: CngxChipStripRovingOptions)

Parameters#

Returns#

CngxChipStripRovingController