Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/FormController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for the OR clause as undefined already equals null

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed please make that change

meta.current.initialValue != null &&
(meta.current.initializeValueIfPristine ? this.state.pristine : true)
) {
Expand Down