Skip to content

Commit 645feb3

Browse files
authored
Fix key for options within groups (#4396)
* Fix key for options within groups * Create gorgeous-yaks-film.md
1 parent 4da6ee0 commit 645feb3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/gorgeous-yaks-film.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-select": patch
3+
---
4+
5+
Fixed keys for options within groups

packages/react-select/src/Select.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ function buildCategorizedOptions(
343343
.map((groupOrOption, groupOrOptionIndex) => {
344344
if (groupOrOption.options) {
345345
const categorizedOptions = groupOrOption.options
346-
.map(option =>
347-
toCategorizedOption(props, option, selectValue, option)
346+
.map((option, optionIndex) =>
347+
toCategorizedOption(props, option, selectValue, optionIndex)
348348
)
349349
.filter(categorizedOption => isFocusable(props, categorizedOption));
350350
return categorizedOptions.length > 0

0 commit comments

Comments
 (0)