diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-07-11 00:57:09 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-07-11 00:57:09 +0200 |
| commit | d643a9a27767d001301f5d8cefc68f227582c446 (patch) | |
| tree | a55b8ad9a35d0def17533c858b1515140423c3cb /apps/web/src/components/editor/timeline.tsx | |
| parent | 92d534760d5bbbef24325db149b816b996f85d72 (diff) | |
| download | opencut-d643a9a27767d001301f5d8cefc68f227582c446.tar.gz | |
small refactor
Diffstat (limited to 'apps/web/src/components/editor/timeline.tsx')
| -rw-r--r-- | apps/web/src/components/editor/timeline.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/web/src/components/editor/timeline.tsx b/apps/web/src/components/editor/timeline.tsx index fb4723d6..53a7aacd 100644 --- a/apps/web/src/components/editor/timeline.tsx +++ b/apps/web/src/components/editor/timeline.tsx @@ -124,6 +124,7 @@ export function Timeline() { const rulerScrollRef = useRef<HTMLDivElement>(null); const tracksScrollRef = useRef<HTMLDivElement>(null); const trackLabelsRef = useRef<HTMLDivElement>(null); + const playheadRef = useRef<HTMLDivElement>(null); const isUpdatingRef = useRef(false); const lastRulerSync = useRef(0); const lastTracksSync = useRef(0); @@ -137,6 +138,7 @@ export function Timeline() { rulerRef, rulerScrollRef, tracksScrollRef, + playheadRef, }); // Timeline content click to seek handler @@ -148,7 +150,7 @@ export function Timeline() { } // Don't seek if clicking on playhead - if ((e.target as HTMLElement).closest(".playhead")) { + if (playheadRef.current?.contains(e.target as Node)) { return; } @@ -880,6 +882,7 @@ export function Timeline() { tracksScrollRef={tracksScrollRef} trackLabelsRef={trackLabelsRef} timelineRef={timelineRef} + playheadRef={playheadRef} /> {/* Timeline Header with Ruler */} <div className="flex bg-panel sticky top-0 z-10"> |
