Skip to content

Commit

Permalink
fix(dropdown): use itemToElement for selected label if not null (#4977)
Browse files Browse the repository at this point in the history
  • Loading branch information
jendowns authored and asudoh committed Jan 9, 2020
1 parent e22dd69 commit 057e35c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react/src/components/Dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ export default class Dropdown extends React.Component {
id={fieldLabelId}
className={`${prefix}--list-box__label`}
{...getLabelProps()}>
{selectedItem ? itemToString(selectedItem) : label}
{selectedItem
? itemToElement
? itemToElement(selectedItem)
: itemToString(selectedItem)
: label}
</span>
<ListBox.MenuIcon
isOpen={isOpen}
Expand Down

0 comments on commit 057e35c

Please sign in to comment.