Skip to content

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

fix toolbar not showing on keyboard open

ammarahm-ed330e0eed5c02
diff --git a/apps/mobile/src/views/Editor/EditorWrapper.js b/apps/mobile/src/views/Editor/EditorWrapper.js
index 7c8b5e502..bb287d5de 100644
--- a/apps/mobile/src/views/Editor/EditorWrapper.js
+++ b/apps/mobile/src/views/Editor/EditorWrapper.js
@@ -1,13 +1,5 @@
import React, { useEffect } from 'react';
-import {
- AppState,
- KeyboardAvoidingView,
- LayoutAnimation,
- Platform,
- SafeAreaView,
- TextInput,
- View
-} from 'react-native';
+import { AppState, KeyboardAvoidingView, SafeAreaView, TextInput, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import Editor from '.';
import { PremiumToast } from '../../components/Premium/premium-toast';
@@ -38,9 +30,9 @@ export const EditorWrapper = ({ width }) => {
useEffect(() => {
if (loading) return;
- AppState.addEventListener('change', onAppStateChanged);
+ let sub = AppState.addEventListener('change', onAppStateChanged);
return () => {
- AppState.removeEventListener('change', onAppStateChanged);
+ sub?.remove();
};
}, [loading]);
@@ -53,8 +45,6 @@ export const EditorWrapper = ({ width }) => {
backgroundColor: state.colors.bg,
borderLeftWidth: DDS.isTab ? 1 : 0,
borderLeftColor: DDS.isTab ? colors.nav : 'transparent'
- // paddingTop: Platform.OS === 'ios' ? insets.top : 0,
- // paddingBottom: Platform.OS === 'ios' ? insets.bottom : 0
}}
>
<SafeAreaView
@@ -69,7 +59,7 @@ export const EditorWrapper = ({ width }) => {
width: '100%',
height: '100%'
}}
- enabled={!floating && Platform.OS === 'ios'}
+ enabled={!floating}
>
<PremiumToast key="toast" context="editor" offset={50 + insets.top} />
<TextInput
diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js
index ee77ea19d..614b254cb 100755
--- a/apps/mobile/src/views/Editor/index.js
+++ b/apps/mobile/src/views/Editor/index.js
@@ -90,10 +90,10 @@ const Editor = React.memo(
testID={notesnook.editor.id}
ref={EditorWebView}
onLoad={onLoad}
- onRenderProcessGone={event => {
+ onRenderProcessGone={() => {
onResetRequested();
}}
- onError={event => {
+ onError={() => {
onResetRequested();
}}
injectedJavaScript={`