uniforms-bootstrap4
Advanced tools
Comparing version 2.3.0 to 2.3.1
{ | ||
"name": "uniforms-bootstrap4", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"license": "MIT", | ||
@@ -32,6 +32,6 @@ "main": "index.js", | ||
"prop-types": "^15.5.7", | ||
"uniforms": "^2.3.0", | ||
"uniforms": "^2.3.1", | ||
"warning": "^4.0.0" | ||
}, | ||
"gitHead": "dfb223c6b8a4751159f32fa0a2b2a69d8265ce45" | ||
"gitHead": "819f8f7b511eee14ea1ec69a81b72c52e157c407" | ||
} |
@@ -57,11 +57,11 @@ "use strict"; | ||
onChange: function onChange(event) { | ||
return props.onChange(event.target.value); | ||
return props.onChange(event.target.value !== '' ? event.target.value : undefined); | ||
}, | ||
ref: props.inputRef, | ||
value: props.value | ||
}, (!!props.placeholder || !props.required) && _react["default"].createElement("option", { | ||
}, (!!props.placeholder || !props.required || props.value === '') && _react["default"].createElement("option", { | ||
value: "", | ||
disabled: props.required, | ||
hidden: props.required | ||
}, props.placeholder ? props.placeholder : props.label), props.allowedValues.map(function (value) { | ||
}, props.placeholder || props.label), props.allowedValues.map(function (value) { | ||
return _react["default"].createElement("option", { | ||
@@ -68,0 +68,0 @@ key: value, |
@@ -46,2 +46,3 @@ import React from 'react'; | ||
)); | ||
const renderSelect = props => ( | ||
@@ -55,9 +56,11 @@ <select | ||
name={props.name} | ||
onChange={event => props.onChange(event.target.value)} | ||
onChange={event => | ||
props.onChange(event.target.value !== '' ? event.target.value : undefined) | ||
} | ||
ref={props.inputRef} | ||
value={props.value} | ||
> | ||
{(!!props.placeholder || !props.required) && ( | ||
{(!!props.placeholder || !props.required || props.value === '') && ( | ||
<option value="" disabled={props.required} hidden={props.required}> | ||
{props.placeholder ? props.placeholder : props.label} | ||
{props.placeholder || props.label} | ||
</option> | ||
@@ -73,2 +76,3 @@ )} | ||
); | ||
const Select = props => | ||
@@ -81,2 +85,3 @@ wrapField( | ||
); | ||
export default connectField(Select); |
88834
2269
Updateduniforms@^2.3.1