# moveItems (@salmonui/dropdowns/listbox)

> The moveItems function of @salmonui/dropdowns/listbox: Moves the items whose values are in values from source to target, inserted at index of target (default: the end), in source order. Returns [nextSource, nextTarget]. When source === target the items move within the list: index is the insertion index in the current list (as a drop position), and both results are the same new array.

Canonical: https://salmonui.dev/docs/reference/dropdowns/listbox/moveItems

```ts
import { moveItems } from '@salmonui/dropdowns/listbox';
```

Entry index: https://salmonui.dev/docs/reference/dropdowns/listbox (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/dropdowns/listbox.md).

## Reference

Kind: function

```ts
function moveItems<T>(source: readonly T[], target: readonly T[], values: Iterable<ListboxKey>, index?: number, getItemValue?: (item: T) => ListboxKey): [
    nextSource: T[],
    nextTarget: T[]
];
```

Moves the items whose values are in `values` from `source` to `target`,
inserted at `index` of `target` (default: the end), in `source` order.
Returns `[nextSource, nextTarget]`. When `source === target` the items
move within the list: `index` is the insertion index in the current list
(as a drop position), and both results are the same new array.
