mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +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]);
|
}, [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 });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue