Skip to content

Commit

Permalink
feat(Virtualizer): allow set any html attributes to container
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeraS committed Dec 11, 2024
1 parent 1bad3db commit 04be85a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/lab/Virtualizer/Virtualizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface VirtualizerApi {
scrollRect: Rect | null;
}

interface VirtualizerProps extends Loadable {
interface VirtualizerProps extends Loadable, React.HTMLAttributes<HTMLDivElement> {
/** The ref of the virtualizer api. */
apiRef?: React.Ref<VirtualizerApi>;
/** The ref of the scroll container element. */
Expand Down Expand Up @@ -70,6 +70,7 @@ export function Virtualizer({
loading,
onLoadMore,
persistedIndexes,
...props
}: VirtualizerProps) {
const scrollContainerRef = React.useRef<HTMLDivElement>(null);
const ref = useForkRef(containerRef, scrollContainerRef);
Expand Down Expand Up @@ -110,12 +111,12 @@ export function Virtualizer({

return (
<div
{...props}
ref={ref}
role="presentation"
style={{
...props.style,
overflow: 'auto',
contain: disableVirtualization ? undefined : 'strict',
height: '100%',
}}
>
{renderRows({
Expand Down

0 comments on commit 04be85a

Please sign in to comment.