Skip to content

Commit

Permalink
fix: do not use FlatList inside ScrollView
Browse files Browse the repository at this point in the history
  • Loading branch information
Atala committed Oct 16, 2024
1 parent a8bcf10 commit 6327265
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions src/navigation/task/Complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,27 +337,19 @@ const FailureReasonForm = ({ data, onChange }) => {
{({
handleChange,
handleBlur,
values,
errors,
setFieldValue,
}) =>
<FlatList
data={ _.filter(data, item => item.type !== 'hidden') }
keyExtractor={ item => item.name }
renderItem={({ item }) => {

return (
<FormControl mb="2" key={ item.name }>
<FormControl.Label>{ item.label }</FormControl.Label>
<Input
defaultValue={ item.value.toString() }
keyboardType={ item.type === 'number' ? 'number-pad' : 'default' }
onChangeText={ handleChange(item.name) }
onBlur={ handleBlur(item.name) } />
</FormControl>
)
}}
/>
<>
{_.filter(data, item => item.type !== 'hidden').map(item =>
<FormControl mb="2" key={ item.name }>
<FormControl.Label>{ item.label }</FormControl.Label>
<Input
defaultValue={ item.value.toString() }
keyboardType={ item.type === 'number' ? 'number-pad' : 'default' }
onChangeText={ handleChange(item.name) }
onBlur={ handleBlur(item.name) } />
</FormControl>
)}
</>
}
</Formik>
)
Expand Down

0 comments on commit 6327265

Please sign in to comment.