react-final-form-arrays icon indicating copy to clipboard operation
react-final-form-arrays copied to clipboard

`dirtySinceLastSubmit` doesn't update when fields push/remove

Open donrsh opened this issue 6 years ago • 2 comments

Are you submitting a bug report or a feature request?

Bug report

What is the current behavior?

meta.dirtySinceLastSubmit is not updated after fields.push or fields.remove call. Though not tested yet, I doubt the same problem exists in other fields methods.

What is the expected behavior?

(See sandbox link)

  1. click "Submit" button
  2. click "Add a habit" button

Expect the habits field array to have meta.dirtySinceLastSubmit === true

Sandbox Link

https://codesandbox.io/s/upbeat-pine-23rt4

What's your environment?

Other information

donrsh avatar May 21 '19 05:05 donrsh

As a workaround, I add an invisible field, and call form.change to set that invisible field along with fields mutation calls to force dirtySinceLastSubmit update.

donrsh avatar May 21 '19 05:05 donrsh

Same problem

ghost avatar May 24 '19 07:05 ghost