@@ -12,10 +12,18 @@ class Animateaaa extends ACustomAnimate<any> {
1212 if ( this . from . x !== this . to . x ) {
1313 const x = end ? this . to . x : this . from . x + Math . floor ( ( this . to . x - this . from . x ) * ratio ) ;
1414 this . params . table . scrollLeft = x ;
15+ if ( ratio === 1 && this . to . targetCol !== - 1 ) {
16+ // ensure scrollToCol is called at the end of animation to avoid not reaching the target col
17+ this . params . table . scrollToCol ( this . to . targetCol , false ) ;
18+ }
1519 }
1620 if ( this . from . y !== this . to . y ) {
1721 const y = end ? this . to . y : this . from . y + Math . floor ( ( this . to . y - this . from . y ) * ratio ) ;
1822 this . params . table . scrollTop = y ;
23+ if ( ratio === 1 && this . to . targetRow !== - 1 ) {
24+ // ensure scrollToRow is called at the end of animation to avoid not reaching the target row
25+ this . params . table . scrollToRow ( this . to . targetRow , false ) ;
26+ }
1927 }
2028 }
2129}
@@ -70,7 +78,9 @@ export class TableAnimationManager {
7078
7179 const to = {
7280 x : isNumber ( col ) ? left - this . table . getFrozenColsWidth ( ) : this . table . scrollLeft ,
73- y : isNumber ( row ) ? top - this . table . getFrozenRowsHeight ( ) : this . table . scrollTop
81+ y : isNumber ( row ) ? top - this . table . getFrozenRowsHeight ( ) : this . table . scrollTop ,
82+ targetRow : rowInt ?? - 1 ,
83+ targetCol : colInt ?? - 1
7484 } ;
7585 const duration = ! isBoolean ( animationOption ) ? animationOption ?. duration ?? 3000 : animationOption ? 3000 : 0 ;
7686 const easing = ! isBoolean ( animationOption ) ? animationOption ?. easing ?? 'linear' : animationOption ? 'linear' : '' ;
0 commit comments