Skip to content

Commit

Permalink
fix(mobile): swipe right maybe open menu (#8981)
Browse files Browse the repository at this point in the history
  • Loading branch information
CatsJuice committed Dec 2, 2024
1 parent 4744896 commit b8467a9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const SwipeMenu = ({

const deltaX = isOpenRef.current ? dragX - normalWidth : dragX;
const prevShouldExecute = shouldExecute;
shouldExecute = Math.abs(deltaX) > executeThreshold;
shouldExecute = deltaX < -executeThreshold;
if (shouldExecute && !prevShouldExecute) {
haptics.impact({ style: 'LIGHT' });
}
Expand All @@ -145,7 +145,7 @@ export const SwipeMenu = ({
return;
}
// open
if (Math.abs(deltaX) > normalWidth / 2) {
if (deltaX < -normalWidth / 2) {
animate(content, menu, { deltaX, normalWidth }, -normalWidth);
isOpenRef.current = true;
}
Expand Down

0 comments on commit b8467a9

Please sign in to comment.