Add bounds to prevent swiping the other direction for the same effect without visuals

This commit is contained in:
Gigiaj 2025-06-18 21:56:28 -05:00
parent a6898e1484
commit 566b245254

View file

@ -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 },
}
);