Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Commit

Permalink
feat(DropdownV2): highlight selected item in drop down (#1869)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhao-Yi-Peng authored and asudoh committed Feb 15, 2019
1 parent 8a7bc9e commit 44e9ebd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/DropdownV2/DropdownV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ export default class DropdownV2 extends React.Component {
<ListBox.MenuItem
key={itemToString(item)}
isActive={selectedItem === item}
isHighlighted={highlightedIndex === index}
isHighlighted={
highlightedIndex === index ||
(selectedItem && selectedItem.id === item.id) ||
false
}
{...getItemProps({ item, index })}>
{itemToElement ? (
<ItemToElement key={itemToString(item)} {...item} />
Expand Down

0 comments on commit 44e9ebd

Please sign in to comment.