text field warning

This commit is contained in:
Amine Ben hammou
2018-05-08 13:40:38 +01:00
parent d0b1579731
commit d2f98bc2e5

View File

@@ -10,8 +10,8 @@ const FormFieldText = React.createClass({
if (this.props.onValueChange instanceof Function) {
value = item[this.props.field.name];
// set value to defaultValue if available
value = (value === undefined && this.props.field.defaultValue) ?
this.props.field.defaultValue : value;
value = (value === undefined) ?
(this.props.field.defaultValue || '') : value;
}
// defaultValue should only be set only when value is not set
if (!value && this.props.field.defaultValue) {