* various tweaks

* update debounce time

* scroll to top with new events
This commit is contained in:
Josh Hawkins
2024-02-23 07:52:54 -06:00
committed by GitHub
parent fc94fcb2ac
commit 7d18c2c03d
5 changed files with 91 additions and 64 deletions

View File

@@ -113,7 +113,10 @@ function useDraggableHandler({
}
});
if (setHandlebarTime) {
setHandlebarTime(timelineStart - segmentIndex * segmentDuration);
setHandlebarTime(
timelineStart -
(newHandlePosition / segmentHeight) * segmentDuration
);
}
}
}
@@ -132,10 +135,10 @@ function useDraggableHandler({
// TODO: determine when we want to do this
const handlebar = scrollTimeRef.current;
if (handlebar && showHandlebar) {
// handlebar.scrollIntoView({
// behavior: "smooth",
// block: "center",
// });
handlebar.scrollIntoView({
behavior: "smooth",
block: "center",
});
}
}, []);