mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-24 07:29:30 +01:00
fix: refocus editor when enter from background
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user