diff options
| author | Maze Winther <mazewinther@gmail.com> | 2025-08-05 14:07:05 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2025-08-05 14:07:05 +0200 |
| commit | 4f6d0142866653507fabf34644a238be44951b30 (patch) | |
| tree | b85a6fbd9800866d34f782f46691320d75267015 /apps/web/src/components/editor/timeline/timeline-playhead.tsx | |
| parent | b83e6bedb7ff5de5a1c13b7e159bb6e094ba5398 (diff) | |
| download | opencut-4f6d0142866653507fabf34644a238be44951b30.tar.gz | |
fix: remaining timeline issues with targeting wrong radix ui scroll element
Diffstat (limited to 'apps/web/src/components/editor/timeline/timeline-playhead.tsx')
| -rw-r--r-- | apps/web/src/components/editor/timeline/timeline-playhead.tsx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/apps/web/src/components/editor/timeline/timeline-playhead.tsx b/apps/web/src/components/editor/timeline/timeline-playhead.tsx index 695843a4..e84512ce 100644 --- a/apps/web/src/components/editor/timeline/timeline-playhead.tsx +++ b/apps/web/src/components/editor/timeline/timeline-playhead.tsx @@ -51,9 +51,7 @@ export function TimelinePlayhead({ // Track scroll position to lock playhead to frame useEffect(() => { - const tracksViewport = tracksScrollRef.current?.querySelector( - "[data-radix-scroll-area-viewport]" - ) as HTMLElement; + const tracksViewport = tracksScrollRef.current; if (!tracksViewport) return; @@ -86,9 +84,7 @@ export function TimelinePlayhead({ // Get the timeline content width and viewport width for right boundary const timelineContentWidth = duration * TIMELINE_CONSTANTS.PIXELS_PER_SECOND * zoomLevel; - const tracksViewport = tracksScrollRef.current?.querySelector( - "[data-radix-scroll-area-viewport]" - ) as HTMLElement; + const tracksViewport = tracksScrollRef.current; const viewportWidth = tracksViewport?.clientWidth || 1000; // Constrain playhead to never appear outside the timeline area |
