Permalink
Browse files

Merge pull request JedWatson#1512 from rndm2/master

Fixed bug. No more comparing objects in getFocusableOptionIndex
  • Loading branch information...
JedWatson committed Mar 17, 2017
2 parents 2249f26 + a0972e3 commit bb7516946dc0b772fcedde061208c5971d88b785
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/Select.js
View
@@ -1024,7 +1024,14 @@ const Select = React.createClass({
let focusedOption = this.state.focusedOption || selectedOption;
if (focusedOption && !focusedOption.disabled) {
const focusedOptionIndex = options.indexOf(focusedOption);
let focusedOptionIndex = -1;
options.some((option, index) => {
const isOptionEqual = option.value === focusedOption.value;
if (isOptionEqual) {
focusedOptionIndex = index;
}
return isOptionEqual;
});
if (focusedOptionIndex !== -1) {
return focusedOptionIndex;
}

0 comments on commit bb75169

Please sign in to comment.