From 5a648ecfe453159a02c44f85193ad256475d5d0e Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 7 Mar 2019 16:41:44 +0000 Subject: [PATCH] Ensure we always set some value in Field Always set some value on the Field's input so that it doesn't flip flop between controlled and uncontrolled. --- src/components/views/elements/Field.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/Field.js b/src/components/views/elements/Field.js index 5bb4067ae2..36f6f02ff2 100644 --- a/src/components/views/elements/Field.js +++ b/src/components/views/elements/Field.js @@ -88,8 +88,8 @@ export default class Field extends React.PureComponent { inputProps.onChange = this.onChange; // make sure we use the current `value` for the field and not the original one - if (this.value != undefined) { - inputProps.value = this.value; + if (inputProps.value === undefined) { + inputProps.value = this.value || ""; } const fieldInput = React.createElement(inputElement, inputProps, children);