mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +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 deltaX = isOpenRef.current ? dragX - normalWidth : dragX;
|
||||||
const prevShouldExecute = shouldExecute;
|
const prevShouldExecute = shouldExecute;
|
||||||
shouldExecute = Math.abs(deltaX) > executeThreshold;
|
shouldExecute = deltaX < -executeThreshold;
|
||||||
if (shouldExecute && !prevShouldExecute) {
|
if (shouldExecute && !prevShouldExecute) {
|
||||||
haptics.impact({ style: 'LIGHT' });
|
haptics.impact({ style: 'LIGHT' });
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ export const SwipeMenu = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// open
|
// open
|
||||||
if (Math.abs(deltaX) > normalWidth / 2) {
|
if (deltaX < -normalWidth / 2) {
|
||||||
animate(content, menu, { deltaX, normalWidth }, -normalWidth);
|
animate(content, menu, { deltaX, normalWidth }, -normalWidth);
|
||||||
isOpenRef.current = true;
|
isOpenRef.current = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user