Skip to content

Commit

Permalink
Fix typing of Dropdown component + Add the possibility to have an emp…
Browse files Browse the repository at this point in the history
…ty message template even with virtualscroll
  • Loading branch information
jbernard-s4m committed Mar 28, 2023
1 parent d6891cf commit 1bdb6e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/lib/dropdown/DropdownPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ export const DropdownPanel = React.memo(
itemTemplate: (item, options) => item && createItem(item, options.index, options),
contentTemplate: (options) => {
const className = classNames('p-dropdown-items', options.className);
const content = isEmptyFilter ? createEmptyMessage() : options.children;
const emptyMessage = props.hasFilter ? props.emptyFilterMessage : props.emptyMessage;
const content = isEmptyFilter ? createEmptyMessage(emptyMessage) : options.children;

return (
<ul ref={options.contentRef} style={options.style} className={className} role="listbox">
Expand Down
2 changes: 1 addition & 1 deletion components/lib/dropdown/dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export interface DropdownProps extends Omit<React.DetailedHTMLProps<React.InputH
/**
* The template of filter element.
*/
filterTemplate?: React.ReactNode | ((options: DropdownFilterOptions) => React.ReactNode) | undefined;
filterTemplate?: React.ReactNode | ((options: { filterOptions: DropdownFilterOptions }) => React.ReactNode) | undefined;
/**
* Reference of the focusable input element.
*/
Expand Down

0 comments on commit 1bdb6e1

Please sign in to comment.