From 6944df27337109ef31e0927832a08d2c72aa0cc8 Mon Sep 17 00:00:00 2001 From: Vytautas Lozickas Date: Thu, 11 Jul 2024 12:45:16 +0300 Subject: [PATCH] Fix primefaces#6858: Make getOptionLabel function on the Dropdown component always return a string --- components/lib/dropdown/Dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/dropdown/Dropdown.js b/components/lib/dropdown/Dropdown.js index 77e531c121..7b1782fa7d 100644 --- a/components/lib/dropdown/Dropdown.js +++ b/components/lib/dropdown/Dropdown.js @@ -888,7 +888,7 @@ export const Dropdown = React.memo( const getOptionLabel = (option) => { const optionLabel = props.optionLabel ? ObjectUtils.resolveFieldData(option, props.optionLabel) : option ? option['label'] : ObjectUtils.resolveFieldData(option, 'label'); - return ObjectUtils.isNotEmpty(optionLabel) ? optionLabel : option; + return `${optionLabel}`; }; const getOptionValue = (option) => {