layout: dismiss system context menu popup when selecting text on iPad, closes #1485 (#1549)

This commit is contained in:
Huang Xin
2025-07-07 20:57:04 +08:00
committed by GitHub
parent a9e0090275
commit 74e1b733a9
4 changed files with 37 additions and 17 deletions
@@ -120,7 +120,9 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => {
detail.doc?.addEventListener('touchstart', handleTouchStart);
detail.doc?.addEventListener('touchmove', handleTouchmove);
detail.doc?.addEventListener('touchend', handleTouchEnd);
detail.doc?.addEventListener('pointerup', () => handlePointerup(doc, index));
detail.doc?.addEventListener('pointerup', (ev: PointerEvent) =>
handlePointerup(doc, index, ev),
);
detail.doc?.addEventListener('selectionchange', () => handleSelectionchange(doc, index));
// Disable the default context menu on mobile devices,