Open 311chaos opened 6 years ago
*pseudo-code
Thanks @lukeschunk . I could edit it, but I guess I will leave it to forever memorialize my mistake.
sudo code
You sound like my boss! 🤣 ❤️
I have been trying to find work arounds for this issue, and have discovered some additional issues. It seems the latest updates to final-form-arrays
or react-final-form-arrays
have made the issue worse.
An example of move NOT working in the most basic way while using the latest lib versions:
https://codesandbox.io/s/jz63zn3mkv
If you downgrade that same code (as taken from the example in the repo) to older versions of final-form, it starts to work again:
The problem with this is the unmount from react-final-form still reference to old field names even when the index changes. However final form should handle deletion of validators in a more graceful manner inside unsubscription and not completely failed
Please fix this...it's killing me slowly...
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 aField
, that has aField
as child. The idea is that we only show themaxLength
field if the parentisList
field istrue
. Sorry, for the sudo-code here, but this is an example of the nesting:The fields all work fine this way, however when using
move
as provided from theFieldArray
'sfields
property, it results in an error: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?
Other information