React-native-keyboard-aware-scroll-view: React Native released <KeyboardAvoidingView /> anyone used it?

Created on 20 Aug 2016  路  40Comments  路  Source: APSL/react-native-keyboard-aware-scroll-view

Hey Guys,

I've used this library for a while now and it's been great but I just saw that react native released in RN 0.29. Although I like this module, I generally will revert to the react native stock code instead of using an addition module. Has anyone used it? Is it any good?

Here's a link to the commit adding <KeyboardAvoidingView />

React Native question

Most helpful comment

@wootwoot1234 Do you test it with <ScrollView/>? After removing keyboard, it makes extra slack on the bottom. um...

All 40 comments

I've seen that component @wootwoot1234, but I haven't used it yet. It would be great if it provided the same functionality of my component. The keyboard handling is something that I feel that should live in the core.

I am consideration <KeyboardAvoidingView /> component as @wootwoot1234
I followed react native docs, however it doesn't work as my expectation.
Please let me know if there is any update on this issue.

I have switched over to <KeyboardAvoidingView />. It's working great for me. I think there are three options: position, padding, and height. Try out each one, they all work a little different.

@wootwoot1234 Do you test it with <ScrollView/>? After removing keyboard, it makes extra slack on the bottom. um...

I've tried to convert to KeyboardAvoidingView but consistently return to this library, especially for longer forms / scrollviews. This one is basically a plug-and-play replacement for a scrollview, in my experience.

Hi @wootwoot1234,

I also tried to work with _KeyboardAvoidingView_ but for some reason it does not work as I expect it too.

Will you be willing to share a sample of your code ?

@JosephDev I have the same issue with <ScrollView/>. When the keyboard is removed, there is extra slack on the bottom, until you manually scroll the scrollview to bring it back down to cover the slack.

Did you find a solution using <KeyboardAvoidingView /> with <ScrollView/> where it automatically handles the slack removal on keyboard removal?

I think documentation could use some love. It seems like a good PR. I am trying it out, but for now I can't seem to figure out if it is suppose to be a spacer or some kind of wrapper. Current example doesn't seem to be working on android. Visuals would be nice too.

@MovingGifts I think <KeyboardAvoidingView /> is not mature to go production. Currently, stick on this library.

@teodors @JosephDev Sounds good, I opened up an issue with a visual of the issue here. https://github.com/facebook/react-native/issues/10765

For the keyboard avoiding view to properly work you need to have the keyboard as a parent of the scrollview and use the behavior of padding to properly work. @MovingGifts

When using KeyboardAwareScrollView with KeyboardAvoidingView there is a keyboard height white space at the bottom of the KeyboardAvoidingView.

I don't think it's a good option to use both together in the same component.

@JosephDev this fixes the weird extra space on android and makes the height calculate correctly when a ScrollView is a child of KeyboardAvoidingView. Hopefully the react native team will merge the open PR soon

@Lepozepo I did a search and there doesn't seem to be an open PR and even if there is, and they merge it. It is not going to be available until late (last day of) February. Or if you live that renegade life, early February for unstable. So, it still isn't going to be production ready for some time.

@teodors you're right. I'm testing it right now but I'm still running into weird bugs on Android specifically using "height" >_<

Too many weird issue with this even now. :(

Folks, I'm currently searching for contributors for this lib. Is anyone interested?

if you don't see any changed active keyboard changes, try wrapping an empty around the whole document

Hey @MiLeung, Did you fix the issue regarding the withe space in the bottom of the KeyboardAvoidingView? I'm having the same problem when soft keyboard is out.

Only happening on android, in iOs its working perfectly.

screen shot 2017-03-02 at 17 54 11

@pgonzalez-santiago react native 0.42 just released a change that might correct this.https://github.com/facebook/react-native/commit/e3d4ace3ae46e3e4046e1ec5a201b92033deb24a

@iRoachie doesnt work. :( If I set "adjustResize" the keyboard wont push the view up (as in iOs) and it is what i'm trying.

@pgonzalez-santiago It worked fine, make sure you using the behaviour property height and not padding.

Using KeyboardAvoidingView inside a ScrollView on android does nothing with RN0.42 as far as I can see. Or is there a trick to using correctly?

@npomfret have you tried to android:windowSoftInputMode="adjustResize" in the androidManifest?

@pgonzalez-santiago yes, that's what it's set to.

Ah, it works but not if there's anything below the scrollview.

I have tried to use it, doesn't work too well for me. I have tried all the options, sometimes works but with that bottom padding, sometimes doesn't work at all, pretty unstable for now.

@acrazing Followed that with ScrollView. Didn't manage to get it working. Though, if I remove the ScrollView, it pushes the content, alas the keyboard doesn't close after tapping outside an input field. (Plus, my content will inevitably be longer than the height of the screen) :(

Also, don't event want to try react-native-keyboard-aware-scrollview because it seems unmaintained.

works perfect using <KeyboardAvoidingView behavior={'height'} style={{alignItems: 'center',}}> keep in mind that you should not be inside a<ScrollView>

I had a view with <KeyboardAvoidingView> inside <ScrollView> and multiple items inside the <KeyboardAvoidingView>.
When keyboard was opened, the ScrollView size was huge, while user was being able to scroll it down a lot, even if there where no more views.
I tried to debug it and added onLayout prop in <KeyboardAvoidingView>.
Suddenly, the strange behaviour has stopped.

KeyboardAvoidingView just cost me like an hour and I still don't have it working right. Seems super wonky.

I tried RN built-in KeyboardAvoidingView, this library and some other but none of them worked out well.
Because, other libraries and styling interfere the position of the views and react-native somehow can't measure the exact position from a scrollview's top to text input's top position.

I ended up using /hackiftekhar/IQKeyboardManager for iOS. Android has a native keyboard avoiding support that you define in AndroidManifest.

@cihadturhan you used this library with ReactNative? What else you have done to make it works? I am trying without success

@cihadturhan great suggestion! Works like a charm with a new RN 0.59 project, no need to configure anything. Thanks 馃憤

I'll close this for being very old. Thanks for all the comments 馃樆

:D and problem is gone

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KevRyan2 picture KevRyan2  路  4Comments

clfristoe picture clfristoe  路  4Comments

FraserHamilton picture FraserHamilton  路  4Comments

dmr07 picture dmr07  路  5Comments

shimil2017 picture shimil2017  路  3Comments