File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -485,9 +485,10 @@ angular.module('ui.grid')
485
485
var columnCache = self . visibleColumnCache ;
486
486
var maxColumnIndex = columnCache . length - minCols ;
487
487
488
- // Calculate the scroll percentage according to the scrollTop location, if no percentage was provided
488
+ // Calculate the scroll percentage according to the scrollLeft location, if no percentage was provided
489
489
if ( ( typeof ( scrollPercentage ) === 'undefined' || scrollPercentage === null ) && scrollLeft ) {
490
- scrollPercentage = scrollLeft / self . getCanvasWidth ( ) ;
490
+ var horizScrollLength = ( self . getCanvasWidth ( ) - self . getViewportWidth ( ) ) ;
491
+ scrollPercentage = scrollLeft / horizScrollLength ;
491
492
}
492
493
493
494
var colIndex = Math . ceil ( Math . min ( maxColumnIndex , maxColumnIndex * scrollPercentage ) ) ;
You can’t perform that action at this time.
0 commit comments