-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.4.5: Infinite loop with cellnav and enableCellEditOnFocus #6653
Comments
This was most likely caused by the following commit: We need to check it and see what needs to be done to resolve this issue without reintroducing the bugs that it fixed. |
The problem seems to go away if I remove the shorter "rowHeight: 23" and in my local environment I also need to remove "enableHorizontalScrollbar: 2". |
Thanks for being so fast with this |
Alright, thanks for the information. I am going to have to do some more analysis to figure out why the loop reappears. |
Adding headerHeight to topBoundary calculation makes it always larger than pixelsToSeeRow causing an infinite loop. fixes angular-ui#6653
Nevermind.. this doesnt solve when navigating by keys, the loop is still there but not visible. |
…ectly Since scrollIfNecessary is called multiple times when enableCellEditOnFocus is true we need to make sure the scrollbarWidth and footerHeight is accounted for to not cause a loop. fixes angular-ui#6653
The following commit should do it for now. It however feels like i am fixing a symptom and not the underlying cause. Since cellNav feature calls ScrollIfNecessary when navigating, I am not sure why the method needs to be called again from edit feature when enableCellEditOnFocus is active (which requires cellnav). function beginEdit(triggerEvent) {
if (gridCol.colDef.enableCellEditOnFocus === true) {
//If enableCellEditOnFocus is enabled cell will already be focused
beginEditAfterScroll(triggerEvent);
}
else {
//we need to scroll the cell into focus before invoking the editor
$scope.grid.api.core.scrollToIfNecessary($scope.row, $scope.col) .then(function () {
beginEditAfterScroll(triggerEvent);
});
}
}
` |
…ectly Since scrollIfNecessary is called multiple times when enableCellEditOnFocus is true we need to make sure the scrollbarWidth and footerHeight is accounted for to not cause a loop. fixes #6653
…ontalScrollbar: NEVER (#6690) * fix(Grid.js): ScrollIfNecessary does not account for scrollWidth correctly Since scrollIfNecessary is called multiple times when enableCellEditOnFocus is true we need to make sure the scrollbarWidth and footerHeight is accounted for to not cause a loop. fixes #6653 * Add check for gridCol not null Make sure gridCol is not null before checking for enableCellEditOnFocus * fix(Grid.js) Vertical scroll calculates height wrong with enableHorizontalScrollbar: NEVER Use scrollbarHeight instead of scrollbarWidth for vertical scroll calculations. scrollbarHeight has the value 0 when enableHorizontalScrollbar is set to NEVER. Round calculated boundary values as computed style may have decimal number which will not match pixelsToSeeRow
* fix(Grid.js): ScrollIfNecessary does not account for scrollWidth correctly Since scrollIfNecessary is called multiple times when enableCellEditOnFocus is true we need to make sure the scrollbarWidth and footerHeight is accounted for to not cause a loop. fixes #6653 * Add check for gridCol not null Make sure gridCol is not null before checking for enableCellEditOnFocus * fix(Grid.js) Vertical scroll calculates height wrong with enableHorizontalScrollbar: NEVER Use scrollbarHeight instead of scrollbarWidth for vertical scroll calculations. scrollbarHeight has the value 0 when enableHorizontalScrollbar is set to NEVER. Round calculated boundary values as computed style may have decimal number which will not match pixelsToSeeRow * Fix(cellnav.js), do not trigger edit on undefined event Do not trigger a cell edit when the event is undefined, if needed through API pass a null object instead.
… changed. Doing this will prevent us from getting stuck in an infinite loop of triggering the scrollEnd event. fix angular-ui#6653, fix angular-ui#4221
…ectly Since scrollIfNecessary is called multiple times when enableCellEditOnFocus is true we need to make sure the scrollbarWidth and footerHeight is accounted for to not cause a loop. fixes angular-ui#6653
…ontalScrollbar: NEVER (angular-ui#6690) * fix(Grid.js): ScrollIfNecessary does not account for scrollWidth correctly Since scrollIfNecessary is called multiple times when enableCellEditOnFocus is true we need to make sure the scrollbarWidth and footerHeight is accounted for to not cause a loop. fixes angular-ui#6653 * Add check for gridCol not null Make sure gridCol is not null before checking for enableCellEditOnFocus * fix(Grid.js) Vertical scroll calculates height wrong with enableHorizontalScrollbar: NEVER Use scrollbarHeight instead of scrollbarWidth for vertical scroll calculations. scrollbarHeight has the value 0 when enableHorizontalScrollbar is set to NEVER. Round calculated boundary values as computed style may have decimal number which will not match pixelsToSeeRow
…6691) * fix(Grid.js): ScrollIfNecessary does not account for scrollWidth correctly Since scrollIfNecessary is called multiple times when enableCellEditOnFocus is true we need to make sure the scrollbarWidth and footerHeight is accounted for to not cause a loop. fixes angular-ui#6653 * Add check for gridCol not null Make sure gridCol is not null before checking for enableCellEditOnFocus * fix(Grid.js) Vertical scroll calculates height wrong with enableHorizontalScrollbar: NEVER Use scrollbarHeight instead of scrollbarWidth for vertical scroll calculations. scrollbarHeight has the value 0 when enableHorizontalScrollbar is set to NEVER. Round calculated boundary values as computed style may have decimal number which will not match pixelsToSeeRow * Fix(cellnav.js), do not trigger edit on undefined event Do not trigger a cell edit when the event is undefined, if needed through API pass a null object instead.
In ui-grid 4.4.5, with cell-nav and cell-edit features enabled with enableCellEditOnFocus set to true.
Navigating to the last row in the grid gets stuck in an infinite loop (cpu in the tab goes often to 100%) or becomes un-editable
I am able to reproduce the error in the following plunker for both chrome and firefox.
Steps to reproduce: expand all rows, scroll to the bottom, select a cell in the bottom row
http://plnkr.co/edit/cVIvvBzZ6clPMEZzWAjr?p=preview
Use Stack Overflow or Gitter for questions.
The text was updated successfully, but these errors were encountered: