diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-02-02 19:44:27 +0100 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-02-02 19:44:27 +0100 |
| commit | 9ca32e5e39d3a1a7eaf6086f9f0d14e10e03afbd (patch) | |
| tree | 6a02883d074e2bbe245e34eeb3ac592659ce4eec /apps/web | |
| parent | 5120e2efa6c06ad02fd1039c2a94b40782a2ebfc (diff) | |
| download | opencut-9ca32e5e39d3a1a7eaf6086f9f0d14e10e03afbd.tar.gz | |
fix: click empty on track to move playhead
Diffstat (limited to 'apps/web')
| -rw-r--r-- | apps/web/src/components/editor/timeline/index.tsx | 6 | ||||
| -rw-r--r-- | apps/web/src/components/editor/timeline/timeline-track.tsx | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/apps/web/src/components/editor/timeline/index.tsx b/apps/web/src/components/editor/timeline/index.tsx index 7e2b2b66..271bad9b 100644 --- a/apps/web/src/components/editor/timeline/index.tsx +++ b/apps/web/src/components/editor/timeline/index.tsx @@ -423,7 +423,11 @@ export function Timeline() { onResizeStateChange={handleResizeStateChange} onElementMouseDown={handleElementMouseDown} onElementClick={handleElementClick} - onTrackMouseDown={handleSelectionMouseDown} + onTrackMouseDown={(event) => { + handleSelectionMouseDown(event); + handleTracksMouseDown(event); + }} + onTrackClick={handleTracksClick} shouldIgnoreClick={shouldIgnoreClick} /> </div> diff --git a/apps/web/src/components/editor/timeline/timeline-track.tsx b/apps/web/src/components/editor/timeline/timeline-track.tsx index 573bd4b5..47a9f282 100644 --- a/apps/web/src/components/editor/timeline/timeline-track.tsx +++ b/apps/web/src/components/editor/timeline/timeline-track.tsx @@ -31,6 +31,7 @@ interface TimelineTrackContentProps { track: TimelineTrack; }) => void; onTrackMouseDown?: (event: React.MouseEvent) => void; + onTrackClick?: (event: React.MouseEvent) => void; shouldIgnoreClick?: () => boolean; } @@ -46,6 +47,7 @@ export function TimelineTrackContent({ onElementMouseDown, onElementClick, onTrackMouseDown, + onTrackClick, shouldIgnoreClick, }: TimelineTrackContentProps) { const editor = useEditor(); @@ -68,11 +70,13 @@ export function TimelineTrackContent({ return ( <button className={cn("size-full", hasSelectedElements && "bg-panel-accent/35")} - onClick={() => { + onClick={(event) => { if (shouldIgnoreClick?.()) return; clearElementSelection(); + onTrackClick?.(event); }} onMouseDown={(event) => { + event.preventDefault(); onTrackMouseDown?.(event); }} type="button" |
