From 9a2abc76ef7d96fe5afee82f3c1cea15850dad99 Mon Sep 17 00:00:00 2001 From: Jeremy Liberman Date: Fri, 13 Nov 2015 16:46:59 -0600 Subject: [PATCH] Fixes #594 Navigation issues with non-searchable controls --- src/Select.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Select.js b/src/Select.js index d647fda3e5..b21321a3d2 100644 --- a/src/Select.js +++ b/src/Select.js @@ -63,6 +63,7 @@ const Select = React.createClass({ searchable: React.PropTypes.bool, // whether to enable searching feature or not simpleValue: React.PropTypes.bool, // pass the value to onChange as a simple value (legacy pre 1.0 mode), defaults to false style: React.PropTypes.object, // optional style to apply to the control + tabIndex: React.PropTypes.string, // optional tab index of the control value: React.PropTypes.any, // initial field value valueComponent: React.PropTypes.func, // value component to render valueKey: React.PropTypes.string, // path of the label value in option objects @@ -150,6 +151,7 @@ const Select = React.createClass({ // for the non-searchable select, toggle the menu if (!this.props.searchable) { + this.focus(); return this.setState({ isOpen: !this.state.isOpen, }); @@ -474,7 +476,19 @@ const Select = React.createClass({ var className = classNames('Select-input', this.props.inputProps.className); if (this.props.disabled || !this.props.searchable) { if (this.props.multi && valueArray.length) return; - return
 
; + return ( + + ); } return (