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.
This commit is contained in:
parent
ea050683bd
commit
5a648ecfe4
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue