Closed ceefour closed 6 years ago
@ceefour tried to reproduce the issue. Couldn't see anything like above. It will be helpful, if you can create a test repo for us to test.
Gif
@akhil-geekyants Sure, here it is : https://github.com/ceefour/keyboardavoider
@ceefour this is happening only with the latest expo on Android device. Tried a sample app with a long form created using react-native init
. It works fine. KitchenSink app with CRNA also works fine with an older expo version (19.0.1).
Not a NativeBase bug.
Thanks @akhil-geekyants , reported to https://github.com/expo/expo/issues/1073
Closing this issue
@akhil-geekyants Please help me, can you show me where is the working app:
I'm trying to diagnose the problem, but I need to localize first where it is actually happening, because there are so many components at stake which I'm unfamiliar with:
So if you can share me these two working examples (first I need to confirm if they're indeed working in my system) and I can try to triage at which point does it break..
cc @tcdavis @ide re: https://github.com/expo/expo/issues/1073#issuecomment-350120860
@ceefour you can check the sample app created using react-native init
here
For Kitchen Sink App add some extra fields in any of the files to make it exceed the height of the device.
I made it work with https://github.com/APSL/react-native-keyboard-aware-scroll-view on Expo
You need to add this to app.json:
"androidStatusBar": {
"backgroundColor": "#000000"
}
Then:
import React from 'react';
import { Platform, View } from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
const Content = () => (
<KeyboardAwareScrollView
enableOnAndroid
enableAutomaticScroll
keyboardOpeningTime={0}
extraHeight={Platform.select({ android: 200 })}
>
<View>
{props.children}
</View>
</KeyboardAwareScrollView>
);
i am facing the same issue i tried every solution but my problem not solved
Tried to get my head around this here: https://github.com/expo/expo/issues/1073
Could anyone with a better understanding of this let me know if I'm missing something obvious?
@chriswait @waqaramjad Have you found a solution?
I swapped all my instances of <Content>
for <KeyboardAwareScrollView enableOnAndroid>
.
Thanks @chriswait It helped. I added extraScrollHeight. Not sure if there is a way to do without it,
import React from 'react';
import { TextInput, StyleSheet } from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
export default class Settings extends React.Component {
static navigationOptions = {
header: null
};
render() {
return (
<KeyboardAwareScrollView enableOnAndroid extraScrollHeight={200} >
<TextInput placeholder= "Input1" style={styles.input} />
<TextInput placeholder= "Input2" style={styles.input} />
<TextInput placeholder= "Input3" style={styles.input} />
<TextInput placeholder= "Input4" style={styles.input} />
<TextInput placeholder= "Input5" style={styles.input} />
</KeyboardAwareScrollView>
);
}
}
const styles = StyleSheet.create({
input: {
height: 100, borderColor: 'gray', borderWidth: 1, padding: 10, margin: 10
}
});
following this comment https://github.com/expo/expo/issues/1073#issuecomment-467782012
simply adding enableOnAndroid
to Content
make it works (as Content behind the hood is already a keyboaravoidingview-ish )
<Container>
<Content enableOnAndroid>
<Form>
<Item>
<Input />
</Item>
</Form>
</Content>
</Container>
@allan-simon it works, thx
<ScrollView contentContainerStyle={{ height: height - 80, width }} keyboardDismissMode="interactive" keyboardShouldPersistTaps="handled"
it works
Thanks allan-simon, it worked 👍
@allan-simon thanks mate, its worked. I was looking for the problem for about 1 hour...
react-native, react and native-base version
Expected behaviour
Content advertises to replace
KeyboardAwareScrollView
.Actual behaviour
Wrapping the Input/Item with
KeyboardAvoidingView
does not work either.Input:
is obscured:
Steps to reproduce (code snippet or screenshot)
Tried using:
<Content contentContainerStyle={{flex: 1}}>
but made the content squashed.Partial Workaround: As @samarhaider suggests (https://github.com/GeekyAnts/NativeBase/issues/534#issuecomment-344689283) it's possible to use @Andr3wHur5t's
<KeyboardSpacer/>
to allow scrolling manually when keyboard is visible. However, auto-scroll still does not occur even with KeyboardSpacer :Is the bug present in both ios and android or in any one of them?
Only tested with Android 7.0. Probably related to #534, #79.
Tips
I suggest modifying the KitchenSink to add long forms to better test this behavior in the future.