Skip to content

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

fix focusing

ammarahm-ed3b75d455173d
diff --git a/apps/mobile/android/app/src/main/assets/texteditor.html b/apps/mobile/android/app/src/main/assets/texteditor.html
index df4de9b38..0c132930b 100644
--- a/apps/mobile/android/app/src/main/assets/texteditor.html
+++ b/apps/mobile/android/app/src/main/assets/texteditor.html
@@ -1543,7 +1543,6 @@
setTimeout(() => {
if (JSON.parse(data.data).value.length > 0) {
editor.focus();
- editor.setSelection(editor.getText().length - 1, 0);
} else {
document.getElementById('titleInput').focus();
}
@@ -1602,9 +1601,9 @@
editor.setContents(content, 'api');
setTimeout(() => {
- editor.focus();
+
editor.setSelection(editor.getText().length - 1, 0);
- }, 0)
+ }, 500)
} else if (data.data[0] === '<') {
editor.setContents(
@@ -1612,7 +1611,6 @@
'silent'
);
setTimeout(() => {
- editor.focus();
editor.setSelection(editor.getText().length - 1, 0);
}, 0)
diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js
index 77db3a146..914639034 100755
--- a/apps/mobile/src/views/Editor/index.js
+++ b/apps/mobile/src/views/Editor/index.js
@@ -77,11 +77,13 @@ const Editor = ({navigation, noMenu}) => {
}, []);
const loadNote = async item => {
+ EditorWebView.current?.requestFocus();
noMenu ? null : SideMenuEvent.disable();
if (note && note.id) {
dispatch({type: ACTIONS.NOTES});
if (item && item.type === 'new') {
await clearEditor();
+
post('focusTitle');
} else {
note = item;
@@ -95,6 +97,7 @@ const Editor = ({navigation, noMenu}) => {
dispatch({type: ACTIONS.NOTES});
if (item && item.type === 'new') {
await clearEditor();
+
post('focusTitle');
} else {
note = item;
@@ -295,8 +298,6 @@ const Editor = ({navigation, noMenu}) => {
if (note && note.id) {
updateEditor();
} else {
- console.log('i am called');
- EditorWebView.current?.requestFocus();
post('focusTitle');
}
let c = {...colors};