Skip to main content
cngx-src documentation

createReorderCommitHandler

Functionforms/select/reorderable-multi-select

projects/forms/select/shared/reorder-commit-handler.ts

Description#

Plain factory for the reorder-commit flow used by CngxReorderableMultiSelect. Operates on ordered arrays with same-membership semantics.

Why a separate factory (not a flag on createArrayCommitHandler): the array handler's reconcileValues uses sameArrayContents to short-circuit writes when the target matches current state - a pure reorder would silently skip. A bypassReconcile flag would complicate every other call-site; a dedicated factory keeps the array handler's hot path small.

CngxTreeSelect.dispatchValueChange follows the same pattern inline; a future refactor could lift it here.

Signature#

createReorderCommitHandler(opts: ReorderCommitHandlerOptions)

Parameters#

Returns#

ReorderCommitHandler