Skip to content

Commit

Permalink
Fix primefaces#5028: Multiselect filterTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Oct 4, 2023
1 parent 51bb767 commit ae95986
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion components/lib/multiselect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,11 @@ export const MultiSelect = React.memo(
if (ObjectUtils.isNotEmpty(props.maxSelectedLabels) && props.value.length > props.maxSelectedLabels) {
return getSelectedItemsLabel();
} else {
return props.value.reduce((acc, value, index) => acc + (index !== 0 ? ',' : '') + getLabelByValue(value), '');
if (ObjectUtils.isArray(props.value)) {
return props.value.reduce((acc, value, index) => acc + (index !== 0 ? ',' : '') + getLabelByValue(value), '');
} else {
return '';
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions components/lib/multiselect/MultiSelectHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ export const MultiSelectHeader = React.memo((props) => {

if (props.filterTemplate) {
const defaultContentOptions = {
className: containerClassName,
className: filterContainerProps.className,
element: content,
filterOptions: filterOptions,
onFilter: onFilter,
filterIconClassName,
filterIconClassName: props.filterIconClassName,
props
};

Expand Down

0 comments on commit ae95986

Please sign in to comment.