fix(android): fix annotator on Android, closes #2927 (#2946)

This commit is contained in:
Huang Xin
2026-01-14 11:56:38 +01:00
committed by GitHub
parent da5e3a0bd3
commit 44b4f7995b
3 changed files with 7 additions and 8 deletions
@@ -222,7 +222,7 @@ const AnnotationRangeEditor: React.FC<AnnotationRangeEditorProps> = ({
}
return (
<div className='pointer-events-none fixed inset-0 z-40'>
<div className='pointer-events-none fixed inset-0 z-50'>
<Handle
position={currentStart}
isVertical={isVertical}
@@ -260,7 +260,7 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => {
detail.doc?.addEventListener('pointermove', handlePointerMove.bind(null, doc, index), opts);
detail.doc?.addEventListener('pointercancel', handlePointerCancel.bind(null, doc, index));
detail.doc?.addEventListener('pointerup', handlePointerUp.bind(null, doc, index));
detail.doc?.addEventListener('selectionchange', () => handleSelectionchange(doc));
detail.doc?.addEventListener('selectionchange', handleSelectionchange.bind(null, doc, index));
// For PDF selections, enable right-click context menu to directly open translator popup.
if (bookData.book?.format === 'PDF') {
@@ -493,7 +493,7 @@ const Annotator: React.FC<{ bookKey: string }> = ({ bookKey }) => {
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selection?.cfi, bookKey]);
}, [selection, bookKey]);
useEffect(() => {
if (!progress) return;