diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-07-01 19:48:00 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-07-01 19:48:00 +0200 |
| commit | 5d02169d63a6d94b2c56db114dee08aa43494ebc (patch) | |
| tree | 06d33494222ec5cb2c144ca67e50e15a1d670ea9 /apps/web/src/components/editor/timeline.tsx | |
| parent | d95b7a9316424e2a5098ccc9ef1601e40ff0c0b7 (diff) | |
| download | opencut-5d02169d63a6d94b2c56db114dee08aa43494ebc.tar.gz | |
fix: deselect clips by clicking outside of track
Diffstat (limited to 'apps/web/src/components/editor/timeline.tsx')
| -rw-r--r-- | apps/web/src/components/editor/timeline.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/web/src/components/editor/timeline.tsx b/apps/web/src/components/editor/timeline.tsx index 3f984f92..e9f44e64 100644 --- a/apps/web/src/components/editor/timeline.tsx +++ b/apps/web/src/components/editor/timeline.tsx @@ -188,6 +188,14 @@ export function Timeline() { } }; + // Add new click handler for deselection + const handleTimelineClick = (e: React.MouseEvent) => { + // If clicking empty area (not on a clip) and not starting marquee, deselect all clips + if (!(e.target as HTMLElement).closest(".timeline-clip")) { + clearSelectedClips(); + } + }; + // Mouse move to update marquee useEffect(() => { if (!marquee || !marquee.active) return; @@ -1068,7 +1076,7 @@ export function Timeline() { height: `${Math.max(200, Math.min(800, tracks.length * 60))}px`, width: `${dynamicTimelineWidth}px`, }} - onClick={handleTimelineMouseDown} + onClick={handleTimelineClick} onMouseDown={handleTimelineMouseDown} > {tracks.length === 0 ? ( |
