Skip to content

Commit

Permalink
Updates following review
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaestel committed Dec 8, 2016
1 parent 117f81e commit 919c952
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 == null || 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.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 @@ -691,6 +691,11 @@ describe('Select', () => {
expect(onChange, 'was called with', 0);
});

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

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

beforeEach(() => {
Expand Down

0 comments on commit 919c952

Please sign in to comment.