mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-15 19:50:28 +03:00
Add bounds to prevent swiping the other direction for the same effect without visuals
This commit is contained in:
parent
a6898e1484
commit
566b245254
1 changed files with 2 additions and 1 deletions
|
|
@ -47,7 +47,7 @@ export function DraggableMessage({
|
|||
}
|
||||
}
|
||||
|
||||
const xTarget = down ? Math.min(0, mvx) : 0;
|
||||
const xTarget = down ? mvx : 0;
|
||||
const distance = Math.abs(xTarget);
|
||||
|
||||
setEditVisible(canEdit && distance >= EDIT_THRESHOLD);
|
||||
|
|
@ -79,6 +79,7 @@ export function DraggableMessage({
|
|||
axis: 'x',
|
||||
filterTaps: true,
|
||||
threshold: 10,
|
||||
bounds: { right: 0 },
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue