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 committed Jun 2, 2021
1 parent 4c8fc2d commit fa45787
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 fa45787

Please sign in to comment.