From b6555593e32b8f50436c1b8d7a56888fbd0bbecb Mon Sep 17 00:00:00 2001 From: Benjamin Piouffle Date: Fri, 19 May 2017 07:21:40 +1100 Subject: [PATCH] Fix selected option focus when valueKey is not "value" (#1733) * Fix selected option focus when valueKey is not "value" * Revert "Fix selected option focus when valueKey is not "value"" This reverts commit 45f5665e495a4d305743aef22bcc045bc374e1e1. * Fix on src/ instead of lib/ --- src/Select.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Select.js b/src/Select.js index d744ac92d5..63d08bc800 100644 --- a/src/Select.js +++ b/src/Select.js @@ -1025,11 +1025,12 @@ const Select = createClass({ var options = this._visibleOptions; if (!options.length) return null; + const valueKey = this.props.valueKey; let focusedOption = this.state.focusedOption || selectedOption; if (focusedOption && !focusedOption.disabled) { let focusedOptionIndex = -1; options.some((option, index) => { - const isOptionEqual = option.value === focusedOption.value; + const isOptionEqual = option[valueKey] === focusedOption[valueKey]; if (isOptionEqual) { focusedOptionIndex = index; }