Skip to content

Commit 3e3e401

Browse files
authored
[fix] Make getFocusableOptionIndex use valueKey
Currently the `getFocusableOptionIndex` method assumes that the value for a particular option is stored under the `value` key, rather than using the `valueKey` prop like elsewhere. This causes the up/down arrows and option hovering to not work
1 parent 549d20a commit 3e3e401

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ const Select = createClass({
10231023
if (focusedOption && !focusedOption.disabled) {
10241024
let focusedOptionIndex = -1;
10251025
options.some((option, index) => {
1026-
const isOptionEqual = option.value === focusedOption.value;
1026+
const isOptionEqual = option[this.props.valueKey] === focusedOption[this.props.valueKey];
10271027
if (isOptionEqual) {
10281028
focusedOptionIndex = index;
10291029
}

0 commit comments

Comments
 (0)