Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaestel committed Nov 29, 2016
1 parent ef3a468 commit 117f81e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ const Select = React.createClass({
},

renderClear () {
if (!this.props.clearable || (!this.props.value || this.props.value === 0) || (this.props.multi && !this.props.value.length) || this.props.disabled || this.props.isLoading) return;
if (!this.props.clearable || this.props.value == null || this.props.value === 0 || this.props.multi && !this.props.value.length || this.props.disabled || this.props.isLoading) return;
return (
<span className="Select-clear-zone" title={this.props.multi ? this.props.clearAllText : this.props.clearValueText}
aria-label={this.props.multi ? this.props.clearAllText : this.props.clearValueText}
Expand Down
5 changes: 5 additions & 0 deletions test/Select-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,11 @@ describe('Select', () => {
'to have text', 'No');
});

it('displays the X button for false value', () => {
wrapper.setPropsForChild({ value: false });
expect(ReactDOM.findDOMNode(instance).querySelector('.Select-clear'), 'not to equal', undefined);
});

describe('with multi=true', () => {

beforeEach(() => {
Expand Down

0 comments on commit 117f81e

Please sign in to comment.