Closed
Description
Are you submitting a bug report or a feature request?
bug report
What is the current behavior?
We have an array of fruits.
Initial values are: []
Steps to reproduce:
- click insert(0, '') or push('') button.
When an Array Field mounts for the first time with insert or push, it's NOT pristine.
What is the expected behavior?
When a normal Field mounts for the first time, it's pristine. I would expect every inserted or pushed input to be pristine as well.
Sandbox Link
What's your environment?
package | version |
---|---|
final-form | 4.11 |
react-final-form | 4.0.2 |
final-form-arrays | 1.1.1 |
react-final-form-arrays | 2.0.1 |
Activity
erikras commentedon Jul 15, 2019
This is not really a bug. If you
insert(0, undefined)
orpush(undefined)
, they are pristine. That's how non-array fields appearpristine
on first render. The wayfinal-form
handles''
andundefined
is complex and intentional.