Skip to content

🎥 Make videos programmatically with React

`@remotion/studio`: Preserve multi-selection when dragging outlines (#10460)

Jonny Burgereafbf4694a0b
diff --git a/packages/example/src/VisualModeTests/OutlineSelectionCases.tsx b/packages/example/src/VisualModeTests/OutlineSelectionCases.tsx
index dcc932900f..c7f6472927 100644
--- a/packages/example/src/VisualModeTests/OutlineSelectionCases.tsx
+++ b/packages/example/src/VisualModeTests/OutlineSelectionCases.tsx
@@ -496,7 +496,7 @@ export const OutlineSelectionCases: React.FC = () => {
>
<CaseFrame
caseNumber={7}
- status="Gap"
+ status="Baseline"
title="Plain drag preserves direct selection"
summary="Pointer-down on an already-selected outline must not collapse or replace the current multi-selection."
desiredBehavior="Dragging either directly selected item moves every eligible selected item and preserves the complete selection."
diff --git a/packages/studio/src/components/SelectedOutlinePolygon.tsx b/packages/studio/src/components/SelectedOutlinePolygon.tsx
index 99f3af5e3e..c4a829a458 100644
--- a/packages/studio/src/components/SelectedOutlinePolygon.tsx
+++ b/packages/studio/src/components/SelectedOutlinePolygon.tsx
@@ -53,6 +53,7 @@ import {callAddKeyframes} from './Timeline/call-add-keyframe';
import {commitPendingInspectorFields} from './Timeline/focus-inspector-field';
import {getCurrentFrame} from './Timeline/imperative-state';
import {saveSequenceProps} from './Timeline/save-sequence-prop';
+import {PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR} from './Timeline/should-clear-selection-on-pointer-down';
import type {
TimelineSelection,
TimelineSelectionInteraction,
@@ -493,6 +494,7 @@ const SelectedOutlinePolygonUnmemoized: React.FC<{
<>
<polygon
ref={polygonRef}
+ {...{[PREVENT_CLEAR_SELECTION_ON_POINTER_DOWN_ATTR]: 'true'}}
points={points}
fill={effectDropHovered ? TIMELINE_DROP_BLUE_ALPHA_12 : TRANSPARENT}
stroke={BLUE}