@@ -415,7 +415,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
415415 }
416416
417417 public isScrollable ( ) {
418- return this . scrollComponent . size > parseInt ( this . igxForContainerSize , 10 ) ;
418+ return this . scrollComponent . size > parseFloat ( this . igxForContainerSize ) ;
419419 }
420420
421421 protected get embeddedViewNodes ( ) {
@@ -583,8 +583,8 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
583583 }
584584 const containerSize = 'igxForContainerSize' ;
585585 if ( containerSize in changes && ! changes [ containerSize ] . firstChange && this . igxForOf ) {
586- const prevSize = parseInt ( changes [ containerSize ] . previousValue , 10 ) ;
587- const newSize = parseInt ( changes [ containerSize ] . currentValue , 10 ) ;
586+ const prevSize = parseFloat ( changes [ containerSize ] . previousValue ) ;
587+ const newSize = parseFloat ( changes [ containerSize ] . currentValue ) ;
588588 this . _recalcOnContainerChange ( { prevSize, newSize} ) ;
589589 }
590590 }
@@ -641,7 +641,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
641641 return false ;
642642 }
643643 const originalVirtScrollTop = this . _virtScrollPosition ;
644- const containerSize = parseInt ( this . igxForContainerSize , 10 ) ;
644+ const containerSize = parseFloat ( this . igxForContainerSize ) ;
645645 const maxVirtScrollTop = this . _virtSize - containerSize ;
646646
647647 this . _bScrollInternal = true ;
@@ -692,7 +692,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
692692 if ( index < 0 || index > ( this . isRemote ? this . totalItemCount : this . igxForOf . length ) - 1 ) {
693693 return ;
694694 }
695- const containerSize = parseInt ( this . igxForContainerSize , 10 ) ;
695+ const containerSize = parseFloat ( this . igxForContainerSize ) ;
696696 const isPrevItem = index < this . state . startIndex || this . scrollPosition > this . sizesCache [ index ] ;
697697 let nextScroll = isPrevItem ? this . sizesCache [ index ] : this . sizesCache [ index + 1 ] - containerSize ;
698698 if ( nextScroll < 0 ) {
@@ -717,7 +717,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
717717 */
718718 public scrollNext ( ) {
719719 const scr = Math . abs ( Math . ceil ( this . scrollPosition ) ) ;
720- const endIndex = this . getIndexAt ( scr + parseInt ( this . igxForContainerSize , 10 ) , this . sizesCache ) ;
720+ const endIndex = this . getIndexAt ( scr + parseFloat ( this . igxForContainerSize ) , this . sizesCache ) ;
721721 this . scrollTo ( endIndex ) ;
722722 }
723723
@@ -740,7 +740,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
740740 * ```
741741 */
742742 public scrollNextPage ( ) {
743- this . addScroll ( parseInt ( this . igxForContainerSize , 10 ) ) ;
743+ this . addScroll ( parseFloat ( this . igxForContainerSize ) ) ;
744744 }
745745
746746 /**
@@ -751,7 +751,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
751751 * ```
752752 */
753753 public scrollPrevPage ( ) {
754- const containerSize = ( parseInt ( this . igxForContainerSize , 10 ) ) ;
754+ const containerSize = ( parseFloat ( this . igxForContainerSize ) ) ;
755755 this . addScroll ( - containerSize ) ;
756756 }
757757
@@ -774,7 +774,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
774774 // fisrt item is not fully in view
775775 startIndex ++ ;
776776 }
777- const endIndex = this . getIndexAt ( this . scrollPosition + parseInt ( this . igxForContainerSize , 10 ) , this . sizesCache ) ;
777+ const endIndex = this . getIndexAt ( this . scrollPosition + parseFloat ( this . igxForContainerSize ) , this . sizesCache ) ;
778778 return endIndex - startIndex ;
779779 }
780780
@@ -813,7 +813,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
813813 * ```
814814 */
815815 public getScrollForIndex ( index : number , bottom ?: boolean ) {
816- const containerSize = parseInt ( this . igxForContainerSize , 10 ) ;
816+ const containerSize = parseFloat ( this . igxForContainerSize ) ;
817817 const scroll = bottom ? Math . max ( 0 , this . sizesCache [ index + 1 ] - containerSize ) : this . sizesCache [ index ] ;
818818 return scroll ;
819819 }
@@ -837,7 +837,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
837837 const targetNode = index >= this . state . startIndex && index <= this . state . startIndex + this . state . chunkSize ?
838838 this . embeddedViewNodes [ index - this . state . startIndex ] : null ;
839839 const rowHeight = this . getSizeAt ( index ) ;
840- const containerSize = parseInt ( this . igxForContainerSize , 10 ) ;
840+ const containerSize = parseFloat ( this . igxForContainerSize ) ;
841841 const containerOffset = - ( this . scrollPosition - this . sizesCache [ this . state . startIndex ] ) ;
842842 const endTopOffset = targetNode ? targetNode . offsetTop + rowHeight + containerOffset : containerSize + rowHeight ;
843843 return ! targetNode || targetNode . offsetTop < Math . abs ( containerOffset )
@@ -897,7 +897,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
897897 }
898898 const scrToBottom = this . _isScrolledToBottom && ! this . dc . instance . notVirtual ;
899899 if ( scrToBottom && ! this . _isAtBottomIndex ) {
900- const containerSize = parseInt ( this . igxForContainerSize , 10 ) ;
900+ const containerSize = parseFloat ( this . igxForContainerSize ) ;
901901 const maxVirtScrollTop = this . _virtSize - containerSize ;
902902 this . _bScrollInternal = true ;
903903 this . _virtScrollPosition = maxVirtScrollTop ;
@@ -946,7 +946,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
946946 */
947947 protected onScroll ( event ) {
948948 /* in certain situations this may be called when no scrollbar is visible */
949- if ( ! parseInt ( this . scrollComponent . nativeElement . style . height , 10 ) ) {
949+ if ( ! parseFloat ( this . scrollComponent . nativeElement . style . height ) ) {
950950 return ;
951951 }
952952 this . scrollComponent . scrollAmount = event . target . scrollTop ;
@@ -1153,7 +1153,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
11531153 protected onHScroll ( event ) {
11541154 /* in certain situations this may be called when no scrollbar is visible */
11551155 const firstScrollChild = this . scrollComponent . nativeElement . children . item ( 0 ) as HTMLElement ;
1156- if ( ! parseInt ( firstScrollChild . style . width , 10 ) ) {
1156+ if ( ! parseFloat ( firstScrollChild . style . width ) ) {
11571157 return ;
11581158 }
11591159 this . scrollComponent . scrollAmount = event . target . scrollLeft ;
@@ -1326,7 +1326,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
13261326 let maxLength = 0 ;
13271327 const arr = [ ] ;
13281328 let sum = 0 ;
1329- const availableSize = parseInt ( this . igxForContainerSize , 10 ) ;
1329+ const availableSize = parseFloat ( this . igxForContainerSize ) ;
13301330 if ( ! availableSize ) {
13311331 return 0 ;
13321332 }
@@ -1356,7 +1356,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
13561356 const prevItem = this . igxForOf [ prevIndex ] ;
13571357 const prevSize = dimension === 'height' ?
13581358 this . individualSizeCache [ prevIndex ] :
1359- parseInt ( prevItem [ dimension ] , 10 ) ;
1359+ parseFloat ( prevItem [ dimension ] ) ;
13601360 sum = arr . reduce ( reducer , prevSize ) ;
13611361 arr . unshift ( prevItem ) ;
13621362 length = arr . length ;
@@ -1403,19 +1403,19 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
14031403 this . dc . instance . notVirtual = ! ( this . igxForContainerSize && this . dc && this . state . chunkSize < count ) ;
14041404 const scrollable = containerSizeInfo ? this . scrollComponent . size > containerSizeInfo . prevSize : this . isScrollable ( ) ;
14051405 if ( this . igxForScrollOrientation === 'horizontal' ) {
1406- const totalWidth = parseInt ( this . igxForContainerSize , 10 ) > 0 ? this . _calcSize ( ) : 0 ;
1407- if ( totalWidth <= parseInt ( this . igxForContainerSize , 10 ) ) {
1406+ const totalWidth = parseFloat ( this . igxForContainerSize ) > 0 ? this . _calcSize ( ) : 0 ;
1407+ if ( totalWidth <= parseFloat ( this . igxForContainerSize ) ) {
14081408 this . resetScrollPosition ( ) ;
14091409 }
14101410 this . scrollComponent . nativeElement . style . width = this . igxForContainerSize + 'px' ;
14111411 this . scrollComponent . size = totalWidth ;
14121412 }
14131413 if ( this . igxForScrollOrientation === 'vertical' ) {
14141414 const totalHeight = this . _calcSize ( ) ;
1415- if ( totalHeight <= parseInt ( this . igxForContainerSize , 10 ) ) {
1415+ if ( totalHeight <= parseFloat ( this . igxForContainerSize ) ) {
14161416 this . resetScrollPosition ( ) ;
14171417 }
1418- this . scrollComponent . nativeElement . style . height = parseInt ( this . igxForContainerSize , 10 ) + 'px' ;
1418+ this . scrollComponent . nativeElement . style . height = parseFloat ( this . igxForContainerSize ) + 'px' ;
14191419 this . scrollComponent . size = totalHeight ;
14201420 }
14211421 if ( scrollable !== this . isScrollable ( ) ) {
@@ -1512,7 +1512,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
15121512 }
15131513
15141514 protected _calcVirtualScrollPosition ( scrollPosition : number ) {
1515- const containerSize = parseInt ( this . igxForContainerSize , 10 ) ;
1515+ const containerSize = parseFloat ( this . igxForContainerSize ) ;
15161516 const maxRealScrollPosition = this . scrollComponent . size - containerSize ;
15171517 const realPercentScrolled = maxRealScrollPosition !== 0 ? scrollPosition / maxRealScrollPosition : 0 ;
15181518 const maxVirtScroll = this . _virtSize - containerSize ;
@@ -1521,7 +1521,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
15211521
15221522 protected _getItemSize ( item , dimension : string ) : number {
15231523 const dim = item ? item [ dimension ] : null ;
1524- return typeof dim === 'number' ? dim : parseInt ( this . igxForItemSize , 10 ) || 0 ;
1524+ return typeof dim === 'number' ? dim : parseFloat ( this . igxForItemSize ) || 0 ;
15251525 }
15261526
15271527 protected _updateScrollOffset ( ) {
@@ -1545,7 +1545,7 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
15451545 // should update scroll top/left according to change so that same startIndex is in view
15461546 if ( Math . abs ( sizeDiff ) > 0 && this . scrollPosition > 0 ) {
15471547 const offset = this . igxForScrollOrientation === 'horizontal' ?
1548- parseInt ( this . dc . instance . _viewContainer . element . nativeElement . style . left , 10 ) :
1548+ parseFloat ( this . dc . instance . _viewContainer . element . nativeElement . style . left ) :
15491549 Number ( this . dc . instance . _viewContainer . element . nativeElement . style . transform ?. match ( / t r a n s l a t e Y \( ( - ? \d + \. ? \d * ) p x \) / ) ?. [ 1 ] ) ;
15501550 const newSize = this . sizesCache [ this . state . startIndex ] - offset ;
15511551 this . scrollPosition = newSize ;
@@ -1706,8 +1706,8 @@ export class IgxGridForOfDirective<T, U extends T[] = T[]> extends IgxForOfDirec
17061706 }
17071707 const containerSize = 'igxForContainerSize' ;
17081708 if ( containerSize in changes && ! changes [ containerSize ] . firstChange && this . igxForOf ) {
1709- const prevSize = parseInt ( changes [ containerSize ] . previousValue , 10 ) ;
1710- const newSize = parseInt ( changes [ containerSize ] . currentValue , 10 ) ;
1709+ const prevSize = parseFloat ( changes [ containerSize ] . previousValue ) ;
1710+ const newSize = parseFloat ( changes [ containerSize ] . currentValue ) ;
17111711 this . _recalcOnContainerChange ( { prevSize, newSize} ) ;
17121712 }
17131713 }
@@ -1781,7 +1781,7 @@ export class IgxGridForOfDirective<T, U extends T[] = T[]> extends IgxForOfDirec
17811781 public override onHScroll ( scrollAmount ) {
17821782 /* in certain situations this may be called when no scrollbar is visible */
17831783 const firstScrollChild = this . scrollComponent . nativeElement . children . item ( 0 ) as HTMLElement ;
1784- if ( ! this . scrollComponent || ! parseInt ( firstScrollChild . style . width , 10 ) ) {
1784+ if ( ! this . scrollComponent || ! parseFloat ( firstScrollChild . style . width ) ) {
17851785 return ;
17861786 }
17871787 this . scrollComponent . scrollAmount = scrollAmount ;
@@ -1807,7 +1807,7 @@ export class IgxGridForOfDirective<T, U extends T[] = T[]> extends IgxForOfDirec
18071807 size = item . height ;
18081808 }
18091809 } else {
1810- size = parseInt ( item [ dimension ] , 10 ) || 0 ;
1810+ size = parseFloat ( item [ dimension ] ) || 0 ;
18111811 }
18121812 return size ;
18131813 }
@@ -1836,7 +1836,7 @@ export class IgxGridForOfDirective<T, U extends T[] = T[]> extends IgxForOfDirec
18361836 protected override getNodeSize ( rNode : Element , index ?: number ) : number {
18371837 if ( this . igxForScrollOrientation === 'vertical' ) {
18381838 const view = this . _embeddedViews [ index ] ;
1839- return this . _embeddedViewSizesCache . get ( view ) || parseInt ( this . igxForItemSize , 10 ) ;
1839+ return this . _embeddedViewSizesCache . get ( view ) || parseFloat ( this . igxForItemSize ) ;
18401840 } else {
18411841 return super . getNodeSize ( rNode , index ) ;
18421842 }
0 commit comments