@@ -306,7 +306,7 @@ export class CollectionView extends CollectionViewBase {
306306 inter
307307 ? new com . nativescript . collectionview . SpanSizeLookup (
308308 new com . nativescript . collectionview . SpanSizeLookup . Interface ( {
309- getSpanSize : ( position ) => {
309+ getSpanSize : ( position ) => {
310310 const dataItem = this . getItemAtIndex ( position ) ;
311311 return inter ( dataItem , position ) ;
312312 }
@@ -356,10 +356,14 @@ export class CollectionView extends CollectionViewBase {
356356 }
357357
358358 if ( this . hasListeners ( CollectionViewBase . scrollEvent ) ) {
359+ const offset = this . isHorizontal ( ) ? view . computeHorizontalScrollOffset ( ) : view . computeVerticalScrollOffset ( ) ;
360+ const range = view . computeHorizontalScrollRange ( ) ;
361+ const extent = view . computeHorizontalScrollExtent ( ) ;
359362 this . notify ( {
360363 object : this ,
361364 eventName : CollectionViewBase . scrollEvent ,
362- scrollOffset : ( this . isHorizontal ( ) ? view . computeHorizontalScrollOffset ( ) : view . computeVerticalScrollOffset ( ) ) / layout . getDisplayDensity ( )
365+ scrollOffset : offset / layout . getDisplayDensity ( ) ,
366+ scrollOffsetPercentage : offset / ( range - extent )
363367 } ) ;
364368 }
365369
@@ -384,10 +388,14 @@ export class CollectionView extends CollectionViewBase {
384388 this . scrolling = false ;
385389
386390 if ( this . hasListeners ( CollectionViewBase . scrollEndEvent ) ) {
391+ const offset = this . isHorizontal ( ) ? view . computeHorizontalScrollOffset ( ) : view . computeVerticalScrollOffset ( ) ;
392+ const range = view . computeHorizontalScrollRange ( ) ;
393+ const extent = view . computeHorizontalScrollExtent ( ) ;
387394 this . notify ( {
388395 object : this ,
389396 eventName : CollectionViewBase . scrollEndEvent ,
390- scrollOffset : ( this . isHorizontal ( ) ? view . computeHorizontalScrollOffset ( ) : view . computeVerticalScrollOffset ( ) ) / layout . getDisplayDensity ( )
397+ scrollOffset : offset / layout . getDisplayDensity ( ) ,
398+ scrollOffsetPercentage : offset / ( range - extent )
391399 } ) ;
392400 }
393401 } else if ( ! this . scrolling && newState === 1 ) {
0 commit comments