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

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

[Bug] When switching between inputs, the focused input bounces out of view #571

Open subhyde opened 9 months ago

subhyde commented 9 months ago

Description

When the email field is selected, and i click on the password field the scrollview will scroll down appropriately, but bounces back up, which covers the entire password input

If I click on the password field first, the issue does not happen.

Example:

https://github.com/APSL/react-native-keyboard-aware-scroll-view/assets/24516988/640834ac-8934-4e82-b653-44fe7d123baa

Code snippet

  <KeyboardAwareScrollView extraScrollHeight={-insets.bottom}>
   {...input data}
  </KeyboardAwareScrollView>

note: Extra scroll height prop is just because I'm using a safe area view. Removing SafeAreaView does not fix the bug

subhyde commented 9 months ago

the issue lies within the keyboardOpeningTime. If i do this i am able to bypass the weird bounce animation. However, im not exactly sure what the memory implications of using numbers.max_value are

 <KeyboardAwareScrollView extraScrollHeight={-insets.bottom} keyboardOpeningTime={Number.MAX_VALUE} >
taha200 commented 4 months ago

Thank you @subhyde