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 22, 2020
1 parent 1b43b94 commit 934baa6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ define([
removeRow: function (rowElement) {
var self = this;
var focusedCell = this._focusedEditorCell;
var row = this.row(rowElement);

if (focusedCell && focusedCell.row.id === this.row(rowElement).id) {
if (focusedCell && row && focusedCell.row.id === row.id) {
this._previouslyFocusedEditorCell = focusedCell;
// Pause the focusout handler until after this row has had
// time to re-render, if this removal is part of an update.
Expand Down

0 comments on commit 934baa6

Please sign in to comment.