mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix(mobile): swipe right maybe open menu (#8981)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user