final-form / final-form/react-final-form

Nested Fields can cause issues (FieldArray > Field > Field)

Open
#326 6 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

### Are you submitting a **bug report** or a **feature request**?

I think it could be a bug, but perhaps I am doing something that is not intended.

### What is the current behavior?

I have a scenario where I have a `FieldArray` with a `Field`, that has a `Field` as child. The idea is that we only show the `maxLength` field if the parent `isList` field is `true`. Sorry, for the sudo-code here, but this is an example of the nesting:

```

{({ fields }) => {
{fields.map((name, index) => (




{({input, meta}) => (

{input.isList ? (

### What is the expected behavior?
Fields would move, and the form would not explode.

### Sandbox Link

At the default state, click the massively oversized "Move" button.

https://codesandbox.io/s/32p402x3om

### What's your environment?

"final-form": "4.10.0",
"final-form-arrays": "1.1.0",
"react": "16.4.0",
"react-dom": "16.4.0",
"react-final-form": "3.6.5",
"react-final-form-arrays": "1.0.6",
"styled-components": "3.3.2"

### Other information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.