Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(mobile): swipe right maybe open menu (#8981)

CatsJuiceb8467a91b8d6
diff --git a/packages/frontend/core/src/mobile/components/swipe-menu/index.tsx b/packages/frontend/core/src/mobile/components/swipe-menu/index.tsx
index 6e1b0339d9..5fe1484d6f 100644
--- a/packages/frontend/core/src/mobile/components/swipe-menu/index.tsx
+++ b/packages/frontend/core/src/mobile/components/swipe-menu/index.tsx
@@ -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' });
}
@@ -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;
}