diff --git a/CHANGELOG.md b/CHANGELOG.md index 45d806b8..ed7a7d95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.36.0 (Nov 1st, 2022) + +- array fields add and remove now trigger onValueSet + ## 4.35.2 (Oct 26th, 2022) - multistep type improvements diff --git a/src/hooks/useArrayField.js b/src/hooks/useArrayField.js index 66f40670..86c2b0ab 100644 --- a/src/hooks/useArrayField.js +++ b/src/hooks/useArrayField.js @@ -86,6 +86,7 @@ export const useArrayField = ({ // We need to manually do a pull from the form state formController.pullOut(`${name}[${i}]`); formApi.setDirt(name, []); + formController.emitter.emit('field-value-set', name); }; const swap = (a, b) => { @@ -127,6 +128,7 @@ export const useArrayField = ({ // If we added a new field we are no longer pristine formApi.setPristine(false); formApi.setDirt(name, []); + formController.emitter.emit('field-value-set', name); }; const addWithInitialValue = initialValue => {