fix editor focusing

This commit is contained in:
ammarahm-ed
2021-01-10 10:59:57 +05:00
parent 785b3ebb0e
commit 512aee9c8c
2 changed files with 5 additions and 3 deletions

View File

@@ -66,7 +66,7 @@ const ActionSheetWrapper = ({
/> />
} }
onClose={() => { onClose={() => {
if (editing.isFocused) { if (editing.isFocused === true) {
post('blur'); post('blur');
if (editing.focusType == "editor") { if (editing.focusType == "editor") {
post('focusEditor'); post('focusEditor');

View File

@@ -169,7 +169,7 @@ export const loadNote = async (item) => {
if (!webviewInit) { if (!webviewInit) {
EditorWebView.current?.reload(); EditorWebView.current?.reload();
} }
} else if (item && item.type === 'intent') { } /* else if (item && item.type === 'intent') {
await clearEditor(); await clearEditor();
clearNote(); clearNote();
id = null; id = null;
@@ -177,13 +177,15 @@ export const loadNote = async (item) => {
data: item.data, data: item.data,
type: 'delta', type: 'delta',
}; };
intent = true; intent = true;
if (webviewInit) { if (webviewInit) {
await loadNoteInEditor(); await loadNoteInEditor();
} else { } else {
EditorWebView.current?.reload(); EditorWebView.current?.reload();
} }
} else { } */ else {
editing.isFocused = false;
clearTimer(); clearTimer();
await setNote(item); await setNote(item);
sendNoteEditedEvent({ sendNoteEditedEvent({