Skip to content

Commit

Permalink
Fix initialValue check
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitryDushkin authored and Dmitry Dushkin committed Jan 14, 2017
1 parent adc0189 commit ba44b80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/uniforms/src/connectField.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export default function connectField (component, {
return;
}

if (props.value === undefined && props.required) {
if (
props.required
&& (this.options.ensureValue ? props.value === '' : props.value === undefined)
) {
props.onChange(props.initialValue);
}
}
Expand Down

0 comments on commit ba44b80

Please sign in to comment.