From 5d9b8acd0d45286fcd7c467fceaeabbefaa2266e Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Thu, 14 Jan 2021 14:25:36 +0500 Subject: [PATCH] fix focus after actionsheet close --- apps/mobile/initializer.root.js | 4 ++-- .../src/components/ActionSheetComponent/ActionSheetWrapper.js | 1 + apps/mobile/src/views/Editor/EditorHeader.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/mobile/initializer.root.js b/apps/mobile/initializer.root.js index 9f1541b43..2ac8b04c9 100644 --- a/apps/mobile/initializer.root.js +++ b/apps/mobile/initializer.root.js @@ -43,12 +43,11 @@ let currentTab = 0; const onChangeTab = async (obj) => { if (obj.i === 1) { eSendEvent(eCloseSideMenu); - if (getIntent()) return; movedAway = false; currentTab = 1; activateKeepAwake(); eSendEvent('navigate'); - editing.isFocused = false; + if (!editing.currentlyEditing || !getNote()) { eSendEvent(eOnLoadNote, {type: 'new'}); editing.currentlyEditing = true; @@ -62,6 +61,7 @@ const onChangeTab = async (obj) => { movedAway = true; post('blur'); } + editing.isFocused = false; currentTab = 0; eSendEvent(eOpenSideMenu); } diff --git a/apps/mobile/src/components/ActionSheetComponent/ActionSheetWrapper.js b/apps/mobile/src/components/ActionSheetComponent/ActionSheetWrapper.js index ba4a48348..f9eb329cd 100644 --- a/apps/mobile/src/components/ActionSheetComponent/ActionSheetWrapper.js +++ b/apps/mobile/src/components/ActionSheetComponent/ActionSheetWrapper.js @@ -66,6 +66,7 @@ const ActionSheetWrapper = ({ /> } onClose={() => { + console.log(editing.isFocused,editing.focusType) if (editing.isFocused === true) { post('blur'); if (editing.focusType == "editor") { diff --git a/apps/mobile/src/views/Editor/EditorHeader.js b/apps/mobile/src/views/Editor/EditorHeader.js index 37fc83d3f..e10a9f99a 100644 --- a/apps/mobile/src/views/Editor/EditorHeader.js +++ b/apps/mobile/src/views/Editor/EditorHeader.js @@ -71,6 +71,7 @@ const EditorHeader = () => { } return true; } + editing.isFocused = false; editing.currentlyEditing = false; if (DDS.isLargeTablet()) { if (fullscreen) {