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/src/components/editor/timeline/timeline-track.tsx | |
| parent | 5120e2efa6c06ad02fd1039c2a94b40782a2ebfc (diff) | |
| download | opencut-9ca32e5e39d3a1a7eaf6086f9f0d14e10e03afbd.tar.gz | |
fix: click empty on track to move playhead
Diffstat (limited to 'apps/web/src/components/editor/timeline/timeline-track.tsx')
| -rw-r--r-- | apps/web/src/components/editor/timeline/timeline-track.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
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" |
