Skip to content

Commit

Permalink
Disable vertical scrolling when dragging across the timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
t1mp4 committed Jan 22, 2025
1 parent 2d69bc4 commit 4eb2760
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,18 @@ const Timeline: VoidComponent<TimelineProps> = (props) => {
title="Disengaged"
onMouseDown={onMouseDownOrTouchStart}
onTouchStart={(ev) => {
handledTouchStart = false
onMouseDownOrTouchStart(ev)
if (ev.touches.length === 1) {
handledTouchStart = false
document.querySelector('main')!.style.overflowY = 'hidden'
onMouseDownOrTouchStart(ev)
}
handledTouchStart = true
}}
onTouchEnd={(ev) => {
if (ev.touches.length === 0) {
document.querySelector('main')!.style.overflowY = ''
}
}}
onTouchMove={(ev) => {
if (ev.touches.length !== 1 || !route()) return
const rect = ref.getBoundingClientRect()
Expand Down

0 comments on commit 4eb2760

Please sign in to comment.