summaryrefslogtreecommitdiff
path: root/apps/web/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/components')
-rw-r--r--apps/web/src/components/editor/timeline-track.tsx14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/web/src/components/editor/timeline-track.tsx b/apps/web/src/components/editor/timeline-track.tsx
index 0dd1ca1b..4ba22164 100644
--- a/apps/web/src/components/editor/timeline-track.tsx
+++ b/apps/web/src/components/editor/timeline-track.tsx
@@ -58,6 +58,19 @@ export function TimelineTrackContent({
const handleMouseMove = (e: MouseEvent) => {
if (!timelineRef.current) return;
+ // On first mouse move during drag, ensure the clip is selected
+ if (dragState.clipId && dragState.trackId) {
+ const isSelected = selectedClips.some(
+ (c) =>
+ c.trackId === dragState.trackId && c.clipId === dragState.clipId
+ );
+
+ if (!isSelected) {
+ // Select this clip (replacing other selections) since we're dragging it
+ selectClip(dragState.trackId, dragState.clipId, false);
+ }
+ }
+
const timelineRect = timelineRef.current.getBoundingClientRect();
const mouseX = e.clientX - timelineRect.left;
const mouseTime = Math.max(0, mouseX / (50 * zoomLevel));
@@ -139,6 +152,7 @@ export function TimelineTrackContent({
const handleClipMouseDown = (e: React.MouseEvent, clip: TypeTimelineClip) => {
setMouseDownLocation({ x: e.clientX, y: e.clientY });
+
// Handle multi-selection only in mousedown
if (e.metaKey || e.ctrlKey || e.shiftKey) {
selectClip(track.id, clip.id, true);