diff --git a/src/Select.js b/src/Select.js index 9140edd3b9..dd5178f534 100644 --- a/src/Select.js +++ b/src/Select.js @@ -297,7 +297,7 @@ const Select = React.createClass({ if (this.props.multi) { if (typeof value === 'string') value = value.split(this.props.delimiter); if (!Array.isArray(value)) { - if (!value) return []; + if (value === null || value === undefined) return []; value = [value]; } return value.map(this.expandValue).filter(i => i); diff --git a/test/Select-test.js b/test/Select-test.js index 356c0ac55f..ea44a4f4bb 100644 --- a/test/Select-test.js +++ b/test/Select-test.js @@ -469,7 +469,19 @@ describe('Select', () => { ]); }); - it('supports updating the value to 0', () => { + it('supports updating the value to a single value', () => { + + wrapper.setPropsForChild({ + value: 1 + }); + + expect(ReactDOM.findDOMNode(instance), 'queried for', '.Select-value .Select-value-label', + 'to satisfy', [ + expect.it('to have text', 'One') + ]); + }); + + it('supports updating the value to single value of 0', () => { // This test is specifically in case there's a "if (value) {... " somewhere wrapper.setPropsForChild({