APSL / react-native-keyboard-aware-scroll-view

A ScrollView component that handles keyboard appearance and automatically scrolls to focused TextInput.
MIT License
5.26k stars 644 forks source link

Keyboard avoidance resets if component added to scrollview while keyboard is open #299

Open willdady opened 6 years ago

willdady commented 6 years ago

I have TextInputs inside the scroll view. If the user enters an invalid email address an 'error box' is rendered beneath the input effectively increasing the height of the scroll content. When this happen it seems like the view resets back to it's height before the keyboard was opened. This causes the content to be cropped behind the keyboard making it impossible to scroll to it.

If the scroll content changes while the keyboard is open, and the change effects layout, it resets the scrollview to it's non-keyboard-opened state.

alvaromb commented 6 years ago

Hi @willdady!

Can you post your source code?

jordanmkoncz commented 5 years ago

Just ran into the same issue myself! I also have error rendering components which will pop in and out of the ScrollView as the user edits the input (making it valid or invalid). KeyboardAwareScrollView is currently not handling this well, with the focused input disappearing out of view below the keyboard if one of my error rendering components is removed from the ScrollView (because the input is no longer invalid).