Skip to content

Commit 457f3ee

Browse files
author
Anthony HOCQUET
committed
Fix a bug when the last cell was selected
1 parent 4a3a201 commit 457f3ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/features/cellnav/js/cellnav.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,10 @@
10671067
});
10681068
}
10691069

1070+
// In case we created a new row, and we are the new created row by ngRepeat
1071+
// then this cell content might have been selected previously
1072+
refreshCellFocus();
1073+
10701074
function preventMouseDown(evt) {
10711075
//Prevents the foucus event from firing if the click event is already going to fire.
10721076
//If both events fire it will cause bouncing behavior.
@@ -1085,6 +1089,10 @@
10851089

10861090
// Refresh cell focus when a new row id added to the grid
10871091
var dataChangeDereg = uiGridCtrl.grid.registerDataChangeCallback(function (grid) {
1092+
// Clear the focus if it's set to avoid the wrong cell getting focused during
1093+
// a short period of time (from now until $timeout function executed)
1094+
clearFocus();
1095+
10881096
$timeout(refreshCellFocus);
10891097
}, [uiGridConstants.dataChange.ROW]);
10901098

0 commit comments

Comments
 (0)