bietkul / react-native-form-builder

Handle your forms in a smart way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

omatrot opened this issue · 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?

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.