We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
i use a FlatList inside a FieldArray inside a component wrapped with withNextInputAutoFocusForm
FlatList
FieldArray
withNextInputAutoFocusForm
inputs inside the FlatList always have the done button
done
inputs inside the FlatList should display the next button when this is not the last
next
FlatList has a renderItem prop but doesn't have the children prop
renderItem
children
so, getInputs can find the inputs because it search children prop
getInputs
react-native-formik/src/withNextInputAutoFocus.js
Lines 11 to 19 in ab0a017
import { action } from '@storybook/addon-actions'; import { storiesOf } from '@storybook/react-native'; import { FieldArray, Formik } from 'formik'; import React from 'react'; import { FlatList, Text, TextInput, TouchableOpacity, View } from 'react-native'; import { handleTextInput, withNextInputAutoFocusForm, withNextInputAutoFocusInput } from 'react-native-formik'; import { compose } from 'redux'; const TextField = compose( handleTextInput, withNextInputAutoFocusInput, )(TextInput); const NextInputAutoFocus = withNextInputAutoFocusForm(View); const initialFormValues = { someList: ['first item', 'second item', 'third item'] }; storiesOf('fields', module).add('fieldArray', () => ( <Formik initialValues={initialFormValues} onSubmit={action('submit')}> {({ handleSubmit }) => ( <NextInputAutoFocus> <FieldArray name="someList"> {() => ( <FlatList data={initialFormValues.someList} renderItem={({ index }) => <TextField name={`someList[${index}]`} />} keyExtractor={(_item, index) => index.toString()} /> )} </FieldArray> <TouchableOpacity onPress={handleSubmit}> <Text>Submit</Text> </TouchableOpacity> </NextInputAutoFocus> )} </Formik> ));
It seems related to this issue #42 but i'm not sure this is the same problem
Thanks for this module : it's simple and usefull
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
i use a
FlatList
inside aFieldArray
inside a component wrapped withwithNextInputAutoFocusForm
Current behavior
inputs inside the
FlatList
always have thedone
buttonExpected behavior
inputs inside the
FlatList
should display thenext
button when this is not the lastTechnical detail
FlatList
has arenderItem
prop but doesn't have thechildren
propso,
getInputs
can find the inputs because it searchchildren
propreact-native-formik/src/withNextInputAutoFocus.js
Lines 11 to 19 in ab0a017
Demo
It seems related to this issue #42 but i'm not sure this is the same problem
Thanks for this module : it's simple and usefull
The text was updated successfully, but these errors were encountered: