Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions pages/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TouchableWithoutFeedback,
} from "react-native";

import { useWindowDimensions } from "react-native";
import { useWindowDimensions, KeyboardAvoidingView } from "react-native";
import { useKeepAwake } from "expo-keep-awake";
import { useTheme, CommonActions } from "@react-navigation/native";
import { useHeaderHeight } from "@react-navigation/elements";
Expand Down Expand Up @@ -300,15 +300,17 @@ export default function Editor({
windowHeight - 165 - keyboard.keyboardHeight - headerHeight;

return (
<View style={[styles.container, { backgroundColor: colors.background }]}>
<KeyboardAvoidingView
behavior="height"
style={[styles.container, { backgroundColor: colors.background }]}>
<StatusBar style={dark ? "light" : "dark"} />

<ScrollView
keyboardDismissMode="none"
keyboardShouldPersistTaps="always"
ref={scrollParentInput}
style={{
height: noteHeight,
flex: 2
}}
persistentScrollbar={true}
removeClippedSubviews={true}
Expand Down Expand Up @@ -364,14 +366,13 @@ export default function Editor({
{/* ####### Result ##### */}
<ScrollView
ref={scrollParentResult}
contentContainerStyle={{ paddingBottom: 30, flexGrow: 1 }}
contentContainerStyle={{ paddingBottom: 30 }}
persistentScrollbar={true}
keyboardDismissMode="none"
keyboardShouldPersistTaps="always"
keyboardShouldPersistTaps="never"
style={[
styles.resultContainer,
{
top: noteHeight,
backgroundColor: colors.backgroundLevel2,
},
]}
Expand All @@ -391,14 +392,16 @@ export default function Editor({
/>
)}
</ScrollView>
</View>
</KeyboardAvoidingView>
);
}

const styles = StyleSheet.create({
container: {
// This is need for android to work the meaning scrollview
flex: Platform.OS === "android" ? 1 : 0,
flex: 1,
flexDirection: "column",
alignContent: "space-between",
},
input: {
paddingHorizontal: 10,
Expand All @@ -417,10 +420,11 @@ const styles = StyleSheet.create({
borderTopLeftRadius: 24,
fontFamily: "iA Writer Quattro",
width: "100%",
position: "absolute",
height: 165,
minHeight: 165,
backgroundColor: "#E6E6E6",
padding: 16,
paddingTop: 12,
flex: 1,
flexGrow: 1,
},
});