swallow events under the menu if we actually drag

This commit is contained in:
Gigiaj 2025-06-18 20:03:11 -05:00
parent 1e4fccb826
commit 791381c978

View file

@ -24,9 +24,11 @@ export function MobileContextMenu({ isOpen, onClose, children }) {
}, [api, innerHeight, isOpen]); }, [api, innerHeight, isOpen]);
const bind = useDrag( const bind = useDrag(
({ last, movement: [, my], velocities: [, vy] }) => { ({ last, movement: [, my], event }) => {
if (last) { if (last) {
if (my > innerHeight / 4) { if (my > innerHeight / 4) {
event.preventDefault();
event.stopPropagation();
onClose(); onClose();
} else { } else {
api.start({ y: 0 }); api.start({ y: 0 });