Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: refocus editor when enter from background

Ammar Ahmedcce06ed8b38a
diff --git a/apps/mobile/src/screens/editor/wrapper.js b/apps/mobile/src/screens/editor/wrapper.js
index aaf34bd73..05afcf56f 100644
--- a/apps/mobile/src/screens/editor/wrapper.js
+++ b/apps/mobile/src/screens/editor/wrapper.js
@@ -27,10 +27,13 @@ export const EditorWrapper = ({ width }) => {
const floating = useIsFloatingKeyboard();
const onAppStateChanged = async state => {
+ if (editorState().movedAway) return;
if (state === 'active') {
- if (!editorState().movedAway) {
- editorController.current.onReady();
- }
+ editorController.current.onReady();
+ // workaround: refocus editor when return from background
+ await editorController.current?.commands.focus();
+ } else {
+ await editorController.current?.commands?.blur();
}
};