From 2f5b5449dbb197ee910bc2f330c3493ce3c4a8a8 Mon Sep 17 00:00:00 2001 From: Jen Downs Date: Wed, 8 Jan 2020 11:32:23 -0600 Subject: [PATCH 1/2] fix(dropdown): use itemToElement for selected label if not null --- packages/react/src/components/Dropdown/Dropdown.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react/src/components/Dropdown/Dropdown.js b/packages/react/src/components/Dropdown/Dropdown.js index 82fcde2dc14d..004b7d9c7ed8 100644 --- a/packages/react/src/components/Dropdown/Dropdown.js +++ b/packages/react/src/components/Dropdown/Dropdown.js @@ -269,7 +269,11 @@ export default class Dropdown extends React.Component { - {selectedItem ? itemToString(selectedItem) : label} + {selectedItem + ? itemToElement + ? itemToElement(selectedItem) + : itemToString(selectedItem) + : label} Date: Thu, 9 Jan 2020 13:43:34 -0600 Subject: [PATCH 2/2] fix(dropdown): run prettier to fix formatting --- packages/react/src/components/Dropdown/Dropdown.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react/src/components/Dropdown/Dropdown.js b/packages/react/src/components/Dropdown/Dropdown.js index b0d176eb5c82..13cc86180657 100644 --- a/packages/react/src/components/Dropdown/Dropdown.js +++ b/packages/react/src/components/Dropdown/Dropdown.js @@ -282,10 +282,10 @@ export default class Dropdown extends React.Component { className={`${prefix}--list-box__label`} {...getLabelProps()}> {selectedItem - ? itemToElement - ? itemToElement(selectedItem) - : itemToString(selectedItem) - : label} + ? itemToElement + ? itemToElement(selectedItem) + : itemToString(selectedItem) + : label}