Skip to content

Commit

Permalink
Fix removing MultiValues that have identical values. Issue #4137 (#4154)
Browse files Browse the repository at this point in the history
* Potential fix for issue #4137

* Added changeset

Co-authored-by: Jed Watson <jed.watson@me.com>
  • Loading branch information
brenshanny and JedWatson authored Dec 12, 2020
1 parent 24ba870 commit a0133f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lazy-singers-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-select": patch
---

Creatable: Fixed removing MultiValues that have identical values. See issue #4137 for details.
2 changes: 1 addition & 1 deletion packages/react-select/src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ export default class Select extends Component<Props, State> {
}}
isFocused={isOptionFocused}
isDisabled={isDisabled}
key={this.getOptionValue(opt)}
key={`${this.getOptionValue(opt)}${index}`}
index={index}
removeProps={{
onClick: () => this.removeValue(opt),
Expand Down

0 comments on commit a0133f1

Please sign in to comment.