react-native-form-builder icon indicating copy to clipboard operation
react-native-form-builder copied to clipboard

[iOS] keyboard appearance makes form scroll up an becomes invisible

Open omatrot opened this issue 6 years ago • 1 comments

This is a strange one. The form is working fine on Android.

On iOS as soon as the keyboard shows up the form foes up and disappears in the containing scroll view. I have to drag it back down to interract with the fields.

Any idea?

omatrot avatar Apr 16 '19 14:04 omatrot

I was getting this same error, running on iOS, with dependencies: "react-native-keyboard-aware-scroll-view": "^0.5.0".

I was able to fix it by adding a prop to the KeyboardAwareScrollView component on Line 368 of /src/formBuilder/index.js. The original code is:

<KeyboardAwareScrollView
        keyboardShouldPersistTaps="always"
        extraScrollHeight={20}
        {...this.props.scrollViewProps}
      >

I fixed the error by adding the enableAutomaticScroll prop and setting that to false like so:

<KeyboardAwareScrollView
        keyboardShouldPersistTaps="always"
        extraScrollHeight={20}
        enableAutomaticScroll={false}
        {...this.props.scrollViewProps}
      >

This worked for my use case, but you might need to tweak them further. You can refer to https://github.com/APSL/react-native-keyboard-aware-scroll-view for documentation and available props for the KeyboardAwareScrollView component.

angelalalachang avatar Apr 17 '19 01:04 angelalalachang