diff --git a/src/components/popout/positions/FloatingCardMobilePosition.tsx b/src/components/popout/positions/FloatingCardMobilePosition.tsx index 059f6667..7f890051 100644 --- a/src/components/popout/positions/FloatingCardMobilePosition.tsx +++ b/src/components/popout/positions/FloatingCardMobilePosition.tsx @@ -21,8 +21,21 @@ export function FloatingCardMobilePosition(props: MobilePositionProps) { })); const bind = useDrag( - ({ last, velocity: [, vy], direction: [, dy], movement: [, my] }) => { + ({ + last, + velocity: [, vy], + direction: [, dy], + movement: [, my], + ...event + }) => { if (closing.current) return; + + const isInScrollable = (event.target as HTMLDivElement).closest( + ".overflow-y-auto" + ); + // console.log(my); + if (isInScrollable) return; // Don't attempt to swipe the thing away if it's a scroll area unless the scroll area is at the top and the user is swiping down + const height = cardRect?.height ?? 0; if (last) { // if past half height downwards @@ -69,7 +82,7 @@ export function FloatingCardMobilePosition(props: MobilePositionProps) { return (