Content hides Input when keyboard visible (i.e. not keyboard-aware-scroll-view)
See original GitHub issuereact-native, react and native-base version
{
"main": "node_modules/expo/AppEntry.js",
"private": true,
"scripts": {
"test": "node ./node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/samples": "2.1.1",
"@expo/vector-icons": "^6.2.1",
"expo": "^23.0.0",
"firebase": "^4.6.2",
"native-base": "^2.3.3",
"react": "16.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-23.0.0.tar.gz",
"react-native-datepicker": "^1.6.0",
"react-navigation": "^1.0.0-beta.19",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"jest-expo": "^23.0.0"
}
}
Expected behaviour
Content advertises to replace KeyboardAwareScrollView
.
- Auto-Scrolling should happen when I type an input on lower half of screen.
- It is possible to scroll manually to make the input visible.
Actual behaviour
- No auto-scrolling happens. Both with Asus ZenUI keyboard and Google Gboard.
- It’s not possible to scroll manually to make the input visible. (see below for workaround)
Wrapping the Input/Item with KeyboardAvoidingView
does not work either.
Input:
is obscured:
Steps to reproduce (code snippet or screenshot)
<Container>
<Content>
<Form>
...other <Item>s...
<Item stackedLabel>
<Label>Pekerjaan (lainnya)</Label>
<Input value={this.state.userProfile.employment_other}
onChangeText={(text) => this.setState({userProfile: {...this.state.userProfile, employment_other: text}})}/>
</Item>
</Form>
</Content>
</Container>
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.
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
KeyboardAvoidingView with ScrollView - Stack Overflow
This is what my solution would be, it works and scrolls automatically on focus input. I tried this on Expo, hope it helps....
Read more >Using KeyboardAwareScrollView and KeyboardAvoidingView ...
This tutorial explains what KeyboardAvoidingView and KeyboardAwareScrollView are and how to use them for different purposes.
Read more >React Native Keyboard Covering Inputs | by John Tucker
The general problem is that React Native does not automatically account for the on-screen keyboard covering up a portion of the screen. note: ......
Read more >native base keyboardavoidingview - You.com | The AI Search ...
I use the KeyboardAvoidingView, to display the input focused, but when the KeyBoard is showing, the scrollView paddingBottom changes and overlaps the Form....
Read more >react-native-keyboard-aware-scroll-view not working properly
I am trying to use the react-native-keyboard-aware-scroll-view so the keyboard ... visible={this.state.visible} /> <StatusBar barStyle="light-content" ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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:
Then:
following this comment https://github.com/expo/expo/issues/1073#issuecomment-467782012
simply adding
enableOnAndroid
toContent
make it works (as Content behind the hood is already a keyboaravoidingview-ish )