There was an error while loading. Please reload this page.
2 parents 2249f26 + a0972e3 commit bb75169Copy full SHA for bb75169
src/Select.js
@@ -1024,7 +1024,14 @@ const Select = React.createClass({
1024
1025
let focusedOption = this.state.focusedOption || selectedOption;
1026
if (focusedOption && !focusedOption.disabled) {
1027
-const focusedOptionIndex = options.indexOf(focusedOption);
+let focusedOptionIndex = -1;
1028
+options.some((option, index) => {
1029
+const isOptionEqual = option.value === focusedOption.value;
1030
+if (isOptionEqual) {
1031
+focusedOptionIndex = index;
1032
+}
1033
+return isOptionEqual;
1034
+});
1035
if (focusedOptionIndex !== -1) {
1036
return focusedOptionIndex;
1037
}
0 commit comments