Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(mobile): prevent attachment WebView navigation

tianma-ifb1f240d6db5f
diff --git a/apps/mobile/src/components/LocalTiptapEditor.tsx b/apps/mobile/src/components/LocalTiptapEditor.tsx
index 036af794..ec06fea3 100644
--- a/apps/mobile/src/components/LocalTiptapEditor.tsx
+++ b/apps/mobile/src/components/LocalTiptapEditor.tsx
@@ -701,11 +701,13 @@ function LocalTiptapEditorImpl(props: LocalTiptapEditorProps) {
attributes: getMobileEditorInputAttributes(
isViewer ? "edgeever-editor-content edgeever-viewer-content" : "edgeever-editor-content"
),
- handleClick: (_view, _pos, event) => handleMobileResourceEvent(event, onResourcePressRef.current, {
- allowImagePreview: isViewer,
- onImagePreview: onImagePreviewRef.current,
- }),
handleDOMEvents: {
+ // Intercept attachment anchors before ProseMirror's later click phase so
+ // the embedded file:// WebView never follows relative resource URLs.
+ click: (_view, event) => handleMobileResourceEvent(event, onResourcePressRef.current, {
+ allowImagePreview: isViewer,
+ onImagePreview: onImagePreviewRef.current,
+ }),
contextmenu: (_view, event) => handleMobileResourceEvent(event, onResourcePressRef.current, {
allowImagePreview: false,
onImagePreview: onImagePreviewRef.current,