mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-04 14:30:29 +03:00
swallow events under the menu if we actually drag
This commit is contained in:
parent
1e4fccb826
commit
791381c978
1 changed files with 3 additions and 1 deletions
|
|
@ -24,9 +24,11 @@ export function MobileContextMenu({ isOpen, onClose, children }) {
|
|||
}, [api, innerHeight, isOpen]);
|
||||
|
||||
const bind = useDrag(
|
||||
({ last, movement: [, my], velocities: [, vy] }) => {
|
||||
({ last, movement: [, my], event }) => {
|
||||
if (last) {
|
||||
if (my > innerHeight / 4) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
onClose();
|
||||
} else {
|
||||
api.start({ y: 0 });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue