Open sdesmond opened 8 years ago
Anyone had a chance to look at this yet?
I'm having a similar problem. When I'm trying to edit a partially visible field the deregOnGridScroll()
is invoked immediatly.
In my case it only happens when it is the last row that is partially hidden and the part that is hidden is less than the width of the horizontal scrollbar. In the Grid.prototype.scrollToIfNecessary()
method the scrollLength is set to a negative number here:
// Total vertical scroll length of the grid
var scrollLength = (self.renderContainers.body.getCanvasHeight() - self.renderContainers.body.getViewportHeight());
Which means that the percentage in the ScrollEvent is a negative number:
// Turn the scroll position into a percentage and make it an argument for a scroll event
percentage = scrollPixels / scrollLength;
scrollEvent.y = { percentage: percentage };
And when the scrollPercentage is a negative number the scrollTop get set to 0 because in ScrollEvent.prototype.getNewScrollTop
return Math.max(0, scrollYPercentage * scrollLength);
But setting the scrollTop to 0 still leaves the field only partially visible which for some reason fires a scrollevent that cancels edit mode.
This happens when there are enough rows to warrant vertical scrolling. You can kind of see what's happening better on IE11, but it fails in Chrome too.
http://plnkr.co/edit/H7q2BsQupSBI4Um1BmUt?p=preview
Steps to reproduce:
From the debugging I've done, when
beginEditAfterScroll()
in theuiGridCell
directive runs, it sets up thederegOnGridScroll()
function. This function is invoked immediately after edit begins so the edit is immediately canceled.It may be that
Grid.prototype.scrollToIfNecessary()
is trying to scroll when its not needed.