From 117f81e30a9ddaf7d8777f4aa67ed3135499d0c5 Mon Sep 17 00:00:00 2001 From: sgaestel Date: Tue, 29 Nov 2016 09:52:44 +0100 Subject: [PATCH] Fix #1394 --- src/Select.js | 2 +- test/Select-test.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Select.js b/src/Select.js index bfeefc7554..962978a39c 100644 --- a/src/Select.js +++ b/src/Select.js @@ -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 ( { '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(() => {