File tree Expand file tree Collapse file tree 1 file changed +26
-28
lines changed
apps/array/src/renderer/features/sessions/components Expand file tree Collapse file tree 1 file changed +26
-28
lines changed Original file line number Diff line number Diff line change @@ -99,10 +99,6 @@ export function VirtualizedList<T>({
9999 } ) ;
100100 } , [ autoScrollToBottom , items ] ) ;
101101
102- if ( items . length === 0 ) {
103- return null ;
104- }
105-
106102 const virtualItems = virtualizer . getVirtualItems ( ) ;
107103
108104 return (
@@ -111,30 +107,32 @@ export function VirtualizedList<T>({
111107 className = { className }
112108 style = { { height : "100%" , overflow : "auto" } }
113109 >
114- < div
115- style = { {
116- height : virtualizer . getTotalSize ( ) ,
117- width : "100%" ,
118- position : "relative" ,
119- } }
120- >
121- { virtualItems . map ( ( virtualRow ) => (
122- < div
123- key = { virtualRow . key }
124- ref = { virtualizer . measureElement }
125- data-index = { virtualRow . index }
126- style = { {
127- position : "absolute" ,
128- top : 0 ,
129- left : 0 ,
130- width : "100%" ,
131- transform : `translateY(${ virtualRow . start } px)` ,
132- } }
133- >
134- { renderItem ( items [ virtualRow . index ] , virtualRow . index ) }
135- </ div >
136- ) ) }
137- </ div >
110+ { items . length > 0 && (
111+ < div
112+ style = { {
113+ height : virtualizer . getTotalSize ( ) ,
114+ width : "100%" ,
115+ position : "relative" ,
116+ } }
117+ >
118+ { virtualItems . map ( ( virtualRow ) => (
119+ < div
120+ key = { virtualRow . key }
121+ ref = { virtualizer . measureElement }
122+ data-index = { virtualRow . index }
123+ style = { {
124+ position : "absolute" ,
125+ top : 0 ,
126+ left : 0 ,
127+ width : "100%" ,
128+ transform : `translateY(${ virtualRow . start } px)` ,
129+ } }
130+ >
131+ { renderItem ( items [ virtualRow . index ] , virtualRow . index ) }
132+ </ div >
133+ ) ) }
134+ </ div >
135+ ) }
138136 { footer }
139137 </ div >
140138 ) ;
You can’t perform that action at this time.
0 commit comments