From 01432920beed6222a887176c93169e57e6e7d59a Mon Sep 17 00:00:00 2001 From: Juan Castillo Date: Mon, 26 Sep 2022 08:05:10 -0700 Subject: [PATCH] Allow for false and zero field values to be re-initialized correctly --- src/FormController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FormController.js b/src/FormController.js index d2cf725d..828acefe 100644 --- a/src/FormController.js +++ b/src/FormController.js @@ -809,9 +809,10 @@ export class FormController { // Initialize value if needed // If we already have value i.e "saved" // use that ( it was not removed on purpose! ) + // including false and 0 since they are values // Otherwise use the fields initial value if ( - !this.getValue(name) && + (this.getValue(name) == null || this.getValue(name) == undefined) && meta.current.initialValue != null && (meta.current.initializeValueIfPristine ? this.state.pristine : true) ) {