View as Markdown

API reference: @salmonui/buttons/tag-group

moveTagsfunction

import { moveTags } from '@salmonui/buttons/tag-group';
function moveTags<T>(list: readonly T[], values: readonly string[], toIndex: number, getValue?: (item: T) => string): T[];

Moves the entries whose value is in values to the insertion index toIndex of list (an index in the current order, before the moved entries are removed), keeping their relative order. A cross-group drop (onTagDrop) is a filter on the source and a splice on the target.