Merge pull request #358 from TobiasBales/fix-label-for-number-input-with-zero-value

Fix label for number inputs with 0 as value
old
Javi Velasco 2016-03-08 09:58:55 +01:00
commit e97c8da983
1 changed files with 3 additions and 1 deletions

View File

@ -57,9 +57,11 @@ class Input extends React.Component {
[style.withIcon]: icon
}, this.props.className);
const valuePresent = value !== null && value !== undefined && value !== '' && !Number.isNaN(value);
const InputElement = React.createElement(multiline ? 'textarea' : 'input', {
...others,
className: ClassNames(style.input, {[style.filled]: value}),
className: ClassNames(style.input, {[style.filled]: valuePresent}),
onChange: this.handleChange,
ref: 'input',
role: 'input',