Skip to content

Commit

Permalink
SuggestionsList: Try to use a unique "key" (#32344)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored and youknowriad committed Jun 7, 2021
1 parent 5faf21e commit 37394d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/components/src/form-token-field/suggestions-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ class SuggestionsList extends Component {
id={ `components-form-token-suggestions-${ this.props.instanceId }-${ index }` }
role="option"
className={ classeName }
key={ this.props.displayTransform( suggestion ) }
key={
suggestion?.value
? suggestion.value
: this.props.displayTransform( suggestion )
}
onMouseDown={ this.handleMouseDown }
onClick={ this.handleClick( suggestion ) }
onMouseEnter={ this.handleHover( suggestion ) }
Expand Down

0 comments on commit 37394d5

Please sign in to comment.