From 9dbfa980c20ab35648943eea2cff22026c8d2339 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Fri, 4 Jul 2025 00:37:59 +0200 Subject: [PATCH] fix: ensure selecting an already selected clip doesn't deselect it --- apps/web/src/components/editor/timeline-track.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/web/src/components/editor/timeline-track.tsx b/apps/web/src/components/editor/timeline-track.tsx index 8718d30..4d32511 100644 --- a/apps/web/src/components/editor/timeline-track.tsx +++ b/apps/web/src/components/editor/timeline-track.tsx @@ -212,18 +212,16 @@ export function TimelineTrackContent({ return; } - // Handle single selection/deselection + // Handle single selection const isSelected = selectedClips.some( (c) => c.trackId === track.id && c.clipId === clip.id ); - if (isSelected) { - // If clip is selected, deselect it - deselectClip(track.id, clip.id); - } else { + if (!isSelected) { // If clip is not selected, select it (replacing other selections) selectClip(track.id, clip.id, false); } + // If clip is already selected, keep it selected (do nothing) }; const handleTrackDragOver = (e: React.DragEvent) => {