Skip to content

Visualize Your Ideas With Code

fix: timeline will no longer seek when scrolling using the scrollbar (#19)

Ross Esmondc1b168065814
diff --git a/src/components/timeline/Timeline.tsx b/src/components/timeline/Timeline.tsx
index 3b65caaf..88de2cbe 100644
--- a/src/components/timeline/Timeline.tsx
+++ b/src/components/timeline/Timeline.tsx
@@ -125,14 +125,12 @@ export function Timeline() {
event.x - rect.x + newOffset
}px`;
}}
- onMouseUp={event => {
- if (event.button === 0) {
- player.requestSeek(
- Math.floor(
- ((offset + event.x - rect.x) / state.fullLength) * duration,
- ),
- );
- }
+ onClick={event => {
+ player.requestSeek(
+ Math.floor(
+ ((offset + event.x - rect.x) / state.fullLength) * duration,
+ ),
+ );
}}
onMouseMove={event => {
playheadRef.current.style.left = `${event.x - rect.x + offset}px`;