2

I'm trying to use the react-native-keyboard-aware-scroll-view library (0.2.7). It does absolutely nothing for me. What am I doing wrong?

import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'

render() {
  return (
    <KeyboardAwareScrollView>
      <View>
        <TextInput placeholder='hi1' />
        <TextInput placeholder='hi2' />
        <TextInput placeholder='hi3' />
        <TextInput placeholder='hi4' />
        <TextInput placeholder='hi5' />
        <TextInput placeholder='hi6' />
        <TextInput placeholder='hi7' />
      </View>
    </KeyboardAwareScrollView>
  )
}
Molly Harper
  • 2,363
  • 3
  • 26
  • 35

1 Answers1

3

It is now advised to use KeyboardAvoidingView instead. It is provided by React Native API. ;)

yachaka
  • 5,429
  • 1
  • 23
  • 35
  • Thanks - I actually am using that right now, just seeing some weird functionality, so thought I'd experiment with the KeyboardAwareScrollView, but I'll just try and fix the quirks. Appreciate it. – Molly Harper Feb 10 '17 at 18:24
  • Which weird functionality are you experiencing ? – yachaka Feb 11 '17 at 13:14
  • I ended up fixing it, it was due to zIndex's. Thanks! – Molly Harper Feb 13 '17 at 02:25
  • @whitep4nther, how about when you need a scrollview in that KeyboardAvoidingView? Got any working example code? It still seems very glitchy. – Robin Claes Nov 21 '17 at 15:16
  • @RobinClaes Why does it seem glitchy ? With a ScrollView or whatever inside it should work as expected ;) – yachaka Nov 21 '17 at 15:29
  • @RobinClaes oh yeah it's a bug, I even remember stumbling upon it. I even remember finding the line of code that made the bug, it's somewhere inside https://github.com/facebook/react-native/blob/cb6ec7c32141ef5bdde837d7f9d71b7adb83b751/Libraries/Components/Keyboard/KeyboardAvoidingView.js – yachaka Nov 21 '17 at 15:55
  • I didn't spend time to ensure everything went alright but it's something you can fix easily, anyways it's a bug, you're supposed to use KeyboardAvoidingView – yachaka Nov 21 '17 at 15:55
  • 1
    I can't achieve what I want with the KeyboardAvoidingView. It shrinks the View with height/padding, but instead I want the view to retain it's height and just scroll. – Robin Claes Nov 21 '17 at 16:04
  • 1
    Link is not working. – SAM Oct 19 '21 at 12:06