Skip to content

Commit

Permalink
fix: touch dragging not working with overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
94726 committed Jul 9, 2024
1 parent 11a24cc commit 06a0a5e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion aioli/src/Root.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,20 @@ function shouldDrag(el: EventTarget, isDraggingUp: boolean) {
return true
}
// makes sure that pointermove isn't cancelled mid drag
useEventListener(
'touchmove',
(event) => {
if (modal.value && isAllowedToDrag.value) event.preventDefault()
},
{ passive: false },
)
let dragStartY = 0
function onPress(event: PointerEvent) {
if (!allowMouseDrag.value && event.pointerType === 'mouse') return
if (!cancellableClosing.value && !openProp.value) return // Don't allow dragging if the drawer is closed and cancellableClosing is false
if (persistent.value || isDragging.value) return
if (persistent.value) return
if (drawerRef.value && !drawerRef.value.contains(event.target as Node)) return
if ((event.target as HTMLElement)?.draggable) return
drawerHeightRef.value = drawerRef.value?.getBoundingClientRect().height || 0
Expand Down

0 comments on commit 06a0a5e

Please sign in to comment.