Skip to main content
cngx-src documentation

CngxChipRemovalHandlerOptions

Interface

projects/forms/select/shared/chip-removal-handler.ts

Import#

import { CngxChipRemovalHandlerOptions } from '@cngx/forms/select'

Description#

Config for createChipRemovalHandler.

Standard-body flow: disabled-guard → snapshot → compareWith filter → commit branch (optimistic write + beginCommit) or sync branch (values.set(next) + onSyncFinalize). Closures cached per-item via WeakMap for stable identity.

Index#

Instance Properties#

beginCommit#function
ReadonlyOptional

Typically wired to ArrayCommitHandler.beginToggle.

commitAction#Signal
ReadonlyOptional

null → sync path only.

commitMode#Signal
ReadonlyOptional
compareWith#Signal>
ReadonlyOptional

Element-wise equality for filtering.

disabled#Signal
Readonly

When true, removeByValue is a no-op.

onBeforeCommit#function
ReadonlyOptional

Runs before beginCommit. Stash rollback snapshot + mark the toggling option here.

onSyncFinalize#function
ReadonlyOptional

Runs on the sync branch after values.set(next). Consumer emits the change event and announces.

removeOverride#function
ReadonlyOptional

Replaces the entire post-disabled-guard body. WeakMap closure cache still applied. Use for variants whose remove semantics diverge from the standard filter+commit body - e.g. CngxTreeSelect always single-deselects regardless of cascadeChildren. When set, the standard-body fields are ignored.

values#WritableSignal
ReadonlyOptional

Required unless removeOverride is set.