Skip to content

Commit

Permalink
Refactor #4079 - Improve some components due to virtualscroller changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Feb 20, 2023
1 parent bdf4f6f commit cc69614
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions components/lib/autocomplete/AutoCompletePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PrimeReact, { localeOption } from '../api/Api';
import { CSSTransition } from '../csstransition/CSSTransition';
import { Portal } from '../portal/Portal';
import { Ripple } from '../ripple/Ripple';
import { ObjectUtils, classNames } from '../utils/Utils';
import { classNames, ObjectUtils } from '../utils/Utils';
import { VirtualScroller } from '../virtualscroller/VirtualScroller';

export const AutoCompletePanel = React.memo(
Expand Down Expand Up @@ -86,7 +86,7 @@ export const AutoCompletePanel = React.memo(
const className = classNames('p-autocomplete-items', options.className);

return (
<ul ref={options.contentRef} className={className} role="listbox" id={props.listId}>
<ul ref={options.contentRef} style={options.style} className={className} role="listbox" id={props.listId}>
{options.children}
</ul>
);
Expand Down
2 changes: 1 addition & 1 deletion components/lib/dropdown/DropdownPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const DropdownPanel = React.memo(
const content = isEmptyFilter ? createEmptyMessage() : options.children;

return (
<ul ref={options.contentRef} className={className} role="listbox">
<ul ref={options.contentRef} style={options.style} className={className} role="listbox">
{content}
</ul>
);
Expand Down
8 changes: 4 additions & 4 deletions components/lib/listbox/ListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,12 @@ export const ListBox = React.memo(
items: visibleOptions,
onLazyLoad: (event) => props.virtualScrollerOptions.onLazyLoad({ ...event, ...{ filter: visibleOptions } }),
itemTemplate: (item, options) => item && createItem(item, options.index, options),
contentTemplate: (option) => {
const className = classNames('p-listbox-list', option.className);
contentTemplate: (options) => {
const className = classNames('p-listbox-list', options.className);

return (
<ul ref={option.contentRef} className={className} role="listbox" aria-multiselectable={props.multiple} {...ariaProps}>
{option.children}
<ul ref={options.contentRef} style={options.style} className={className} role="listbox" aria-multiselectable={props.multiple} {...ariaProps}>
{options.children}
</ul>
);
}
Expand Down
2 changes: 1 addition & 1 deletion components/lib/multiselect/MultiSelectPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const MultiSelectPanel = React.memo(
const content = isEmptyFilter() ? createEmptyFilter() : options.children;

return (
<ul ref={options.contentRef} className={className} role="listbox" aria-multiselectable>
<ul ref={options.contentRef} style={options.style} className={className} role="listbox" aria-multiselectable>
{content}
</ul>
);
Expand Down

0 comments on commit cc69614

Please sign in to comment.