diff --git a/apps/mobile/app/(app)/(spaces)/page/[pageId]/index.tsx b/apps/mobile/app/(app)/(spaces)/page/[pageId]/index.tsx index f30143f0..16c205b6 100644 --- a/apps/mobile/app/(app)/(spaces)/page/[pageId]/index.tsx +++ b/apps/mobile/app/(app)/(spaces)/page/[pageId]/index.tsx @@ -3,8 +3,6 @@ import { useCallback, useEffect, useState } from 'react'; import { AppState, AppStateStatus, - KeyboardAvoidingView, - Platform, Pressable, StyleSheet, Text, @@ -143,10 +141,7 @@ export default function PageScreen() { )} - + - + {page && ( 50) { + sc.scrollTop = s; + } + }); + }); + }, true); + }); true; `} style={[ @@ -346,9 +365,8 @@ export const PageWebView = ({ ]} javaScriptEnabled domStorageEnabled - scrollEnabled + scrollEnabled={false} bounces={false} - keyboardDisplayRequiresUserAction={false} hideKeyboardAccessoryView automaticallyAdjustContentInsets={false} contentMode="mobile" diff --git a/apps/mobile/webviews/editor/editor.html b/apps/mobile/webviews/editor/editor.html index 9d1bdc3b..6c5f1f84 100644 --- a/apps/mobile/webviews/editor/editor.html +++ b/apps/mobile/webviews/editor/editor.html @@ -56,16 +56,24 @@ html, body { margin: 0; padding: 0; + height: 100%; + overflow: hidden; background-color: var(--background); color: var(--foreground); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; -webkit-text-size-adjust: 100%; + } + #scroll-container { + height: 100%; + overflow-y: auto; -webkit-overflow-scrolling: touch; } -
+
+
+
diff --git a/apps/mobile/webviews/editor/src/document-editor.tsx b/apps/mobile/webviews/editor/src/document-editor.tsx index 1eee35a3..5c2e1e59 100644 --- a/apps/mobile/webviews/editor/src/document-editor.tsx +++ b/apps/mobile/webviews/editor/src/document-editor.tsx @@ -76,6 +76,7 @@ import { TableCommand, TodoCommand, } from '@colanode/ui/editor/commands'; +import { isSlashCommandActive } from '@colanode/ui/editor/extensions/commander'; import { MobilePageNode } from './extensions/page'; import { MobileFolderNode } from './extensions/folder'; import { MobileFileNode } from './extensions/file'; @@ -235,6 +236,15 @@ export const DocumentEditor = ({ 'prose-lg prose-stone dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full text-foreground', spellCheck: 'true', }, + handleDOMEvents: { + mousedown: (_view, event) => { + if (isSlashCommandActive()) { + event.preventDefault(); + return true; + } + return false; + }, + }, }, content: buildEditorContent( node.id, diff --git a/apps/mobile/webviews/editor/src/editor.tsx b/apps/mobile/webviews/editor/src/editor.tsx index bc02bc5e..0a0702b9 100644 --- a/apps/mobile/webviews/editor/src/editor.tsx +++ b/apps/mobile/webviews/editor/src/editor.tsx @@ -180,7 +180,7 @@ export function MobileEditorApp() { style={{ padding: '0 16px', paddingBottom: 'env(safe-area-inset-bottom, 20px)', - minHeight: '100vh', + minHeight: '100%', }} > { slashCommandJustSelected = false; }, 300); selectItem(index); }} >