mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix editing.isFocused set to true outside editor
This commit is contained in:
@@ -35,7 +35,6 @@ import {editorRef, tabBarRef} from './src/utils/Refs';
|
||||
import {EditorWrapper} from './src/views/Editor/EditorWrapper';
|
||||
import {getIntent, getNote, post} from './src/views/Editor/Functions';
|
||||
let {width, height} = Dimensions.get('window');
|
||||
let movedAway = true;
|
||||
let layoutTimer = null;
|
||||
let currentTab = 0;
|
||||
|
||||
@@ -43,7 +42,7 @@ let currentTab = 0;
|
||||
const onChangeTab = async (obj) => {
|
||||
if (obj.i === 1) {
|
||||
eSendEvent(eCloseSideMenu);
|
||||
movedAway = false;
|
||||
editing.movedAway = false;
|
||||
currentTab = 1;
|
||||
activateKeepAwake();
|
||||
eSendEvent('navigate');
|
||||
@@ -58,7 +57,7 @@ const onChangeTab = async (obj) => {
|
||||
if (getNote()?.locked) {
|
||||
eSendEvent(eClearEditor);
|
||||
}
|
||||
movedAway = true;
|
||||
editing.movedAway = true;
|
||||
post('blur');
|
||||
}
|
||||
editing.isFocused = false;
|
||||
@@ -227,7 +226,7 @@ const AppStack = React.memo(
|
||||
paddingHorizontal: 0,
|
||||
},
|
||||
});
|
||||
if (!movedAway && current !== 'tablet') {
|
||||
if (!editing.movedAway && current !== 'tablet') {
|
||||
tabBarRef.current?.goToPage(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,8 @@ export const editing = {
|
||||
type: null,
|
||||
},
|
||||
isFocused:false,
|
||||
focusType:null
|
||||
focusType:null,
|
||||
movedAway:true
|
||||
};
|
||||
export const selection = {
|
||||
data: [],
|
||||
|
||||
@@ -91,7 +91,9 @@ const EditorHeader = () => {
|
||||
}
|
||||
await clearEditor();
|
||||
Keyboard.removeListener('keyboardDidShow', () => {
|
||||
if (!editing.movedAway) {
|
||||
editing.isFocused = true;
|
||||
}
|
||||
post('keyboard');
|
||||
});
|
||||
if (handleBack) {
|
||||
|
||||
@@ -66,7 +66,10 @@ const EditorRoot = () => {
|
||||
await loadNote(item);
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
Keyboard.addListener('keyboardDidShow', () => {
|
||||
console.log(editing.currentlyEditing,'current')
|
||||
if (!editing.movedAway) {
|
||||
editing.isFocused = true;
|
||||
}
|
||||
post('keyboard');
|
||||
});
|
||||
if (!DDS.isTab) {
|
||||
@@ -128,7 +131,9 @@ const EditorRoot = () => {
|
||||
}
|
||||
await clearEditor();
|
||||
Keyboard.removeListener('keyboardDidShow', () => {
|
||||
if (!editing.movedAway) {
|
||||
editing.isFocused = true;
|
||||
}
|
||||
post('keyboard');
|
||||
});
|
||||
if (handleBack) {
|
||||
|
||||
Reference in New Issue
Block a user