File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -389,6 +389,7 @@ function onInputKeyDown(event) {
389
389
scrollMenuIntoView | bool | true | whether the viewport will shift to display the entire menu when engaged
390
390
searchable | bool | true | whether to enable searching feature or not
391
391
searchPromptText | string\| node | 'Type to search' | label to prompt for search input
392
+ loadingPlaceholder | string\| node | 'Loading...' | label to prompt for loading search result
392
393
tabSelectsValue | bool | true | whether to select the currently focused value when the ` [tab] ` key is pressed
393
394
value | any | undefined | initial field value
394
395
valueKey | string | 'value' | the option property to use for the value
Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ var Select = _react2['default'].createClass({
451
451
} ) ;
452
452
} else {
453
453
// otherwise, focus the input and open the menu
454
- this . _openAfterFocus = true ;
454
+ this . _openAfterFocus = this . props . openOnFocus ;
455
455
this . focus ( ) ;
456
456
}
457
457
} ,
@@ -1346,4 +1346,4 @@ var Select = _react2['default'].createClass({
1346
1346
} ) ;
1347
1347
1348
1348
exports [ 'default' ] = Select ;
1349
- module . exports = exports [ 'default' ] ;
1349
+ module . exports = exports [ 'default' ] ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const propTypes = {
13
13
React . PropTypes . node
14
14
] ) ,
15
15
loadOptions : React . PropTypes . func . isRequired , // callback to load options asynchronously; (inputValue: string, callback: Function): ?Promise
16
+ multi : React . PropTypes . bool , // multi-value input
16
17
options : PropTypes . array . isRequired , // array of options
17
18
placeholder : React . PropTypes . oneOfType ( [ // field placeholder, displayed when there's no value (shared with Select)
18
19
React . PropTypes . string ,
Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ const Select = React.createClass({
399
399
} ) ;
400
400
} else {
401
401
// otherwise, focus the input and open the menu
402
- this . _openAfterFocus = true ;
402
+ this . _openAfterFocus = this . props . openOnFocus ;
403
403
this . focus ( ) ;
404
404
}
405
405
} ,
@@ -1132,7 +1132,14 @@ const Select = React.createClass({
1132
1132
1133
1133
let focusedOption = this . state . focusedOption || selectedOption ;
1134
1134
if ( focusedOption && ! focusedOption . disabled ) {
1135
- const focusedOptionIndex = options . indexOf ( focusedOption ) ;
1135
+ let focusedOptionIndex = - 1 ;
1136
+ options . some ( ( option , index ) => {
1137
+ const isOptionEqual = option . value === focusedOption . value ;
1138
+ if ( isOptionEqual ) {
1139
+ focusedOptionIndex = index ;
1140
+ }
1141
+ return isOptionEqual ;
1142
+ } ) ;
1136
1143
if ( focusedOptionIndex !== - 1 ) {
1137
1144
return focusedOptionIndex ;
1138
1145
}
You can’t perform that action at this time.
0 commit comments