File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -685,6 +685,29 @@ describe("List", () => {
685685
686686 render ( < Test /> ) ;
687687 } ) ;
688+
689+ test ( "should not require resizeObserver if height is provided" , ( ) => {
690+ const originalResizeObserver = window . ResizeObserver ;
691+ window . ResizeObserver = vi . fn ( ( ) => ( {
692+ observe : vi . fn ( ) ,
693+ unobserve : vi . fn ( ) ,
694+ disconnect : vi . fn ( )
695+ } ) ) ;
696+
697+ render (
698+ < List
699+ overscanCount = { 0 }
700+ rowCount = { 100 }
701+ rowComponent = { RowComponent }
702+ rowHeight = { 25 }
703+ rowProps = { EMPTY_OBJECT }
704+ style = { { height : 42 } }
705+ />
706+ ) ;
707+
708+ expect ( window . ResizeObserver ) . toHaveBeenCalledTimes ( 0 ) ;
709+ window . ResizeObserver = originalResizeObserver ;
710+ } ) ;
688711 } ) ;
689712
690713 describe ( "aria attributes" , ( ) => {
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export function List<
5050 stopIndexVisible
5151 } = useVirtualizer ( {
5252 containerElement : element ,
53+ containerStyle : style ,
5354 defaultContainerSize : defaultHeight ,
5455 direction : "vertical" ,
5556 itemCount : rowCount ,
You can’t perform that action at this time.
0 commit comments