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 a4406ab
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,17 @@ const Timeline: VoidComponent<TimelineProps> = (props) => {
onMouseDown={onMouseDownOrTouchStart}
onTouchStart={(ev) => {
handledTouchStart = false
onMouseDownOrTouchStart(ev)
if (ev.touches.length === 1) {
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 a4406ab

Please sign in to comment.