MichaelCereda/react-native-form-generator

Usage with KeyboardAwareScrollView (wix): Get refs to actual TextInputs?

skizzo opened this issue · 0 comments

Hi,
I'm using wix's KeyboardAwareScrollView, which comes with the feature of auto-scrolling to specific TextInputs.

For this, I'd need a ref to the actual TextInput component, since the principle is this:

<KeyboardAwareScrollView 
  keyboardShouldPersistTaps={true} 
  style={{flex: 1, paddingHorizontal: 10}}
  getTextInputRefs={() => { 
    const {first_name} = this.refs.registrationForm.refs
    return [first_name]
    // --> this leads to error: textInputRef.isFocused is not a function.
  }}
  >

  <Form
    ref='registrationForm'
    >
    <InputField
      ref='first_name'
      placeholder='First Name'
      />
  </Form>
</KeyboardAwareScrollView>

So my question is, is there any way I can get the actual ref to the TextInput in my getTextInputRefs function?

Thanks!