Skip to content

Commit

Permalink
Editor: fix removeRow bug
Browse files Browse the repository at this point in the history
When OnDemandList is pruning rows it sometimes calls 'removeRow' on a preload
node. Editor's 'removeRow' logic assumes that the node will always be a
valid row node which causes an error when it is not. This commit adds a guard
in `Editor#removeRow` to ensure that a dgrid row object for the node exists.
  • Loading branch information
msssk committed Jun 19, 2020
1 parent 5f38f8d commit c5461d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ return function(column, editor, editOn){
listeners.push(aspect.before(grid, 'removeRow', function (row) {
var focusedCell = grid._focusedEditorCell;
row = grid.row(row);
if (focusedCell && focusedCell.row.id === row.id) {
if (focusedCell && row && focusedCell.row.id === row.id) {
previouslyFocusedCell = focusedCell;

// Pause the focusout handler until after this row has had
Expand Down

0 comments on commit c5461d5

Please sign in to comment.