288288 boxShadow : "0px 5px 25px 5px hsla(0, 0%, 0%, 0.15)" ,
289289 } ) ;
290290
291+ const resizeObserver = new ResizeObserver ( ( ) => {
292+ this . _updateVirtualScroll ( ) ;
293+ } ) ;
294+ resizeObserver . observe ( w ) ;
295+
291296 const header = document . createElement ( "div" ) ;
292297 Object . assign ( header . style , {
293298 background : getComputedStyle ( document . documentElement ) . getPropertyValue (
@@ -1832,12 +1837,14 @@ ${logHTML}
18321837 ) ;
18331838 this . logContainer . innerHTML = "" ;
18341839
1840+ let currentTop = startIndex * this . averageEntryHeight ;
1841+
18351842 for ( let i = startIndex ; i < endIndex ; i ++ ) {
18361843 const entry = this . logEntries [ i ] ;
18371844 const div = document . createElement ( "div" ) ;
18381845 Object . assign ( div . style , {
18391846 position : "absolute" ,
1840- top : `${ i * this . averageEntryHeight } px` ,
1847+ top : `${ currentTop } px` ,
18411848 left : "6px" ,
18421849 right : "6px" ,
18431850 whiteSpace : "pre-wrap" ,
@@ -1848,6 +1855,11 @@ ${logHTML}
18481855 div . innerHTML = this . _formatLogItem ( entry . text ) ;
18491856
18501857 this . logContainer . appendChild ( div ) ;
1858+
1859+ div . style . width = "calc(100% - 12px)" ;
1860+ const rect = div . getBoundingClientRect ( ) ;
1861+ const height = rect . height || this . averageEntryHeight ;
1862+ currentTop += height ;
18511863 }
18521864 }
18531865
0 commit comments