Skip to content

Commit 74b256e

Browse files
committed
fix(mobile): enable editor interaction for new notes
1 parent 3c813f9 commit 74b256e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

apps/mobile/v1/src/hooks/useNoteEditor.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,21 @@ export function useNoteEditor(noteId?: string): UseNoteEditorReturn {
101101
}
102102
pendingContentRef.current = null;
103103
}, 200);
104+
} else if (!contentSetRef.current && !noteId) {
105+
// For new notes (no noteId), show the editor immediately
106+
if (__DEV__) {
107+
console.log('[New Note] Showing editor for new note...');
108+
}
109+
setTimeout(() => {
110+
editor.webviewRef?.current?.injectJavaScript(`
111+
document.body.classList.add('ready');
112+
true;
113+
`);
114+
contentSetRef.current = true;
115+
}, 200);
104116
}
105117
}, CSS_INJECTION_DELAY);
106-
}, [editor, customCSS]);
118+
}, [editor, customCSS, noteId]);
107119

108120
const loadNote = useCallback(async () => {
109121
if (!noteId) return;

apps/mobile/v1/src/screens/EditNote/EditorToolbar.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function EditorToolbar({ editor, keyboardHeight, bottomInset, theme }: Ed
3838
horizontal
3939
showsHorizontalScrollIndicator={false}
4040
contentContainerStyle={styles.toolbarButtons}
41+
centerContent={true}
4142
>
4243
{keyboardHeight > 0 && (
4344
<>
@@ -157,6 +158,8 @@ const styles = StyleSheet.create({
157158
borderTopWidth: 0,
158159
paddingTop: 8,
159160
paddingHorizontal: 8,
161+
alignItems: 'center',
162+
justifyContent: 'center',
160163
},
161164
toolbarButtons: {
162165
flexDirection: 'row',

0 commit comments

Comments
 (0)