Skip to content

Commit

Permalink
feat: forward styles VirtualizerItem (adobe#6998)
Browse files Browse the repository at this point in the history
feat: forward styles to VirtualizerItem
  • Loading branch information
patrickkuhlmann authored Sep 20, 2024
1 parent 53413af commit 6193c40
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/@react-aria/virtualizer/src/VirtualizerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import {useVirtualizerItem, VirtualizerItemOptions} from './useVirtualizerItem';

interface VirtualizerItemProps extends Omit<VirtualizerItemOptions, 'ref'> {
parent?: LayoutInfo | null,
style?: CSSProperties,
className?: string,
children: ReactNode
}

export function VirtualizerItem(props: VirtualizerItemProps) {
let {className, layoutInfo, virtualizer, parent, children} = props;
let {style, className, layoutInfo, virtualizer, parent, children} = props;
let {direction} = useLocale();
let ref = useRef(undefined);
useVirtualizerItem({
Expand All @@ -33,7 +34,7 @@ export function VirtualizerItem(props: VirtualizerItemProps) {
});

return (
<div role="presentation" ref={ref} className={className} style={layoutInfoToStyle(layoutInfo, direction, parent)}>
<div role="presentation" ref={ref} className={className} style={{...layoutInfoToStyle(layoutInfo, direction, parent), ...style}}>
{children}
</div>
);
Expand Down

0 comments on commit 6193c40

Please sign in to comment.