Skip to main content

getCanvasSequenceReorderSelection()v4.0.533

Returns the sequences to move when a timeline drag starts. Dragging a selected sequence moves the entire sequence selection. Dragging an unselected sequence moves only that sequence.

get-reorder-selection.ts
import { getCanvasSequenceReorderSelection, type CanvasSelectionItem, } from '@remotion/sdk'; declare const draggedItem: Extract<CanvasSelectionItem, {type: 'sequence'}>; declare const selectedItems: CanvasSelectionItem[]; const nodePathInfos = getCanvasSequenceReorderSelection({ draggedItem, selectedItems, });

The result follows the order of selectedItems. A source edit can sort the returned nodes by their JSX order. If the selection contains another item type, only draggedItem is returned.

Options​

draggedItem​

The sequence where the drag began.

selectedItems​

The current selection, such as controller.selection.getSnapshot().selectedItems.

Return value​

An array of SequenceNodePathInfo values to move.

Compatibility​

BrowsersEnvironments
Chrome
Firefox
Safari

See also​