Skip to content

Commit 9f9bc7e

Browse files
committed
Merge pull request #4094 from imbalind/issue4046
Fix(core): #4046 - Last column disappearing upon edit
2 parents 36f386f + 7109244 commit 9f9bc7e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/js/core/factories/GridRenderContainer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,10 @@ angular.module('ui.grid')
485485
var columnCache = self.visibleColumnCache;
486486
var maxColumnIndex = columnCache.length - minCols;
487487

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
489489
if ((typeof(scrollPercentage) === 'undefined' || scrollPercentage === null) && scrollLeft) {
490-
scrollPercentage = scrollLeft / self.getCanvasWidth();
490+
var horizScrollLength = (self.getCanvasWidth() - self.getViewportWidth());
491+
scrollPercentage = scrollLeft / horizScrollLength;
491492
}
492493

493494
var colIndex = Math.ceil(Math.min(maxColumnIndex, maxColumnIndex * scrollPercentage));

0 commit comments

Comments
 (0)