mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-29 00:20:04 +01:00
mobile: fix keyboard height incorrect on android
This commit is contained in:
@@ -63,13 +63,16 @@ export const EditorWrapper = ({ width }) => {
|
||||
}, [loading]);
|
||||
|
||||
const getMarginBottom = () => {
|
||||
const bottomInsets = Platform.OS === "android" ? 14 : insets.bottom || 14;
|
||||
const bottomInsets = Platform.OS === "android" ? 12 : insets.bottom || 14;
|
||||
if (!keyboard.keyboardShown) return bottomInsets / 1.5;
|
||||
if (Platform.isPad && !floating) return bottomInsets;
|
||||
if (Platform.OS === "ios") return bottomInsets / 1.5;
|
||||
return bottomInsets;
|
||||
return 0;
|
||||
};
|
||||
|
||||
const KeyboardAvoidingViewIOS =
|
||||
Platform.OS === "ios" ? KeyboardAvoidingView : View;
|
||||
|
||||
return (
|
||||
<View
|
||||
testID="editor-wrapper"
|
||||
@@ -77,17 +80,18 @@ export const EditorWrapper = ({ width }) => {
|
||||
style={{
|
||||
width: width[!introCompleted ? "mobile" : deviceMode]?.c,
|
||||
height: "100%",
|
||||
minHeight: "100%",
|
||||
backgroundColor: colors.bg,
|
||||
borderLeftWidth: DDS.isTab ? 1 : 0,
|
||||
borderLeftColor: DDS.isTab ? colors.nav : "transparent"
|
||||
}}
|
||||
>
|
||||
{loading || !introCompleted ? null : (
|
||||
<KeyboardAvoidingView
|
||||
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
||||
<KeyboardAvoidingViewIOS
|
||||
behavior="padding"
|
||||
style={{
|
||||
flex: 1,
|
||||
marginBottom: getMarginBottom()
|
||||
marginBottom: getMarginBottom(),
|
||||
flex: 1
|
||||
}}
|
||||
enabled={!floating}
|
||||
keyboardVerticalOffset={0}
|
||||
@@ -101,7 +105,7 @@ export const EditorWrapper = ({ width }) => {
|
||||
/>
|
||||
<ProgressBar />
|
||||
<Editor key="editor" withController={true} />
|
||||
</KeyboardAvoidingView>
|
||||
</KeyboardAvoidingViewIOS>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user