Skip to content

Commit 3e02d9d

Browse files
committedMay 27, 2020
_StoreMixin: clamp rows.max to a minimum of 0
If the rows of a grid are removed from bottom to top then each row removal will decrement rows.max, including the final row removal which will set rows.max to -1. This breaks the logic in _StoreMixin's 'add, update' event handler preventing insertion of new rows when items are added to the store. Fixes dojo#1305
1 parent f9f73ca commit 3e02d9d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎_StoreMixin.js

+6
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ define([
532532
rows.max--;
533533
}
534534

535+
// max should never be less than zero; if it is the logic in the 'add, update' handler
536+
// below will prevent insertion of rows (https://github.com/SitePen/dgrid/issues/1305)
537+
if (rows.max < 0) {
538+
rows.max = 0;
539+
}
540+
535541
row = rows[from];
536542

537543
// check to make the sure the node is still there before we try to remove it

0 commit comments

Comments
 (0)