@@ -127,7 +127,7 @@ describe('unlimited size', () => {
127127 it ( 'should manually scroll to end after scroll to index' , async ( ) => {
128128 virtualizer . scrollToIndex ( Math . floor ( virtualizer . size / 2 ) ) ;
129129
130- while ( scrollTarget . scrollTop < scrollTarget . scrollHeight - scrollTarget . clientHeight ) {
130+ while ( Math . ceil ( scrollTarget . scrollTop ) < scrollTarget . scrollHeight - scrollTarget . clientHeight ) {
131131 scrollTarget . scrollTop = scrollTarget . scrollHeight - scrollTarget . clientHeight ;
132132 await oneEvent ( scrollTarget , 'scroll' ) ;
133133 }
@@ -139,7 +139,7 @@ describe('unlimited size', () => {
139139 it ( 'should manually scroll to end after scroll to start' , async ( ) => {
140140 virtualizer . scrollToIndex ( 0 ) ;
141141
142- while ( scrollTarget . scrollTop < scrollTarget . scrollHeight - scrollTarget . clientHeight ) {
142+ while ( Math . ceil ( scrollTarget . scrollTop ) < scrollTarget . scrollHeight - scrollTarget . clientHeight ) {
143143 scrollTarget . scrollTop = scrollTarget . scrollHeight - scrollTarget . clientHeight ;
144144 await oneEvent ( scrollTarget , 'scroll' ) ;
145145 }
@@ -176,7 +176,7 @@ describe('unlimited size', () => {
176176 const elementCount = elementsContainer . children . length ;
177177
178178 let largestIndex ;
179- while ( scrollTarget . scrollTop < scrollTarget . scrollHeight - scrollTarget . clientHeight ) {
179+ while ( Math . ceil ( scrollTarget . scrollTop ) < scrollTarget . scrollHeight - scrollTarget . clientHeight ) {
180180 largestIndex = Math . max ( ...Array . from ( elementsContainer . children ) . map ( ( el ) => el . index ) ) ;
181181
182182 scrollTarget . scrollTop += ( elementHeight * elementCount ) / 2 ;
0 commit comments