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/hooks | |
| parent | 92d534760d5bbbef24325db149b816b996f85d72 (diff) | |
| download | opencut-d643a9a27767d001301f5d8cefc68f227582c446.tar.gz | |
small refactor
Diffstat (limited to 'apps/web/src/hooks')
| -rw-r--r-- | apps/web/src/hooks/use-timeline-playhead.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/web/src/hooks/use-timeline-playhead.ts b/apps/web/src/hooks/use-timeline-playhead.ts index 67f0d20c..61adaf92 100644 --- a/apps/web/src/hooks/use-timeline-playhead.ts +++ b/apps/web/src/hooks/use-timeline-playhead.ts @@ -8,6 +8,7 @@ interface UseTimelinePlayheadProps { rulerRef: React.RefObject<HTMLDivElement>;
rulerScrollRef: React.RefObject<HTMLDivElement>;
tracksScrollRef: React.RefObject<HTMLDivElement>;
+ playheadRef?: React.RefObject<HTMLDivElement>;
}
export function useTimelinePlayhead({
@@ -18,6 +19,7 @@ export function useTimelinePlayhead({ rulerRef,
rulerScrollRef,
tracksScrollRef,
+ playheadRef,
}: UseTimelinePlayheadProps) {
// Playhead scrubbing state
const [isScrubbing, setIsScrubbing] = useState(false);
@@ -48,7 +50,7 @@ export function useTimelinePlayhead({ if (e.button !== 0) return;
// Don't interfere if clicking on the playhead itself
- if ((e.target as HTMLElement).closest(".playhead")) return;
+ if (playheadRef?.current?.contains(e.target as Node)) return;
e.preventDefault();
setIsDraggingRuler(true);
|
