mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
Do not toggle navigation gesture native to avoid unexpected behavior. close AF-1958, AF-1797
14 lines
381 B
TypeScript
14 lines
381 B
TypeScript
import { LiveData } from '@toeverything/infra';
|
|
|
|
export const enableNavigationGesture$ = new LiveData(false);
|
|
|
|
const onTouchStart = (e: TouchEvent) => {
|
|
if (enableNavigationGesture$.value) return;
|
|
|
|
const clientX = e.changedTouches[0].clientX;
|
|
if (clientX <= 25) {
|
|
e.preventDefault();
|
|
}
|
|
};
|
|
document.body.addEventListener('touchstart', onTouchStart, { passive: false });
|