diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-07-04 00:37:59 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-07-04 00:37:59 +0200 |
| commit | 9dbfa980c20ab35648943eea2cff22026c8d2339 (patch) | |
| tree | 5fdf697df1215837f99349db58929ecbba83bf49 | |
| parent | 8be05901fb60c2312a849a18c6e8dc3b48d7c227 (diff) | |
| download | opencut-9dbfa980c20ab35648943eea2cff22026c8d2339.tar.gz | |
fix: ensure selecting an already selected clip doesn't deselect it
| -rw-r--r-- | apps/web/src/components/editor/timeline-track.tsx | 8 |
1 files 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 8718d30a..4d32511f 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) => {
|
