Skip to content

Commit 02b05ca

Browse files
committed
fix(cellNav): fix null ref issue in navigate event for oldRowColumn
scrollTo should not setFocus unless there is an active row and column. Was getting error when using restoreState
1 parent 89461bc commit 02b05ca

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: src/features/cellnav/js/cellnav.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,9 @@
515515
var rowCol = { row: gridRow, col: gridCol };
516516

517517
// Broadcast the navigation
518-
grid.cellNav.broadcastCellNav(rowCol);
518+
if (gridRow !== null && gridCol !== null) {
519+
grid.cellNav.broadcastCellNav(rowCol);
520+
}
519521
});
520522

521523

Diff for: test/unit/core/row-filtering.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('rowSearcher', function() {
5151
});
5252

5353
describe('guessCondition', function () {
54-
iit('should create a RegExp when term ends with a *', function() {
54+
it('should create a RegExp when term ends with a *', function() {
5555
var filter = { term: 'blah*' };
5656

5757
var re = new RegExp(/^blah[\s\S]*?$/i);
@@ -236,7 +236,7 @@ describe('rowSearcher', function() {
236236
expect(ret.length).toEqual(3);
237237
});
238238
});
239-
239+
240240
describe('with a custom filter function', function() {
241241
var custom, ret;
242242
beforeEach(function() {
@@ -250,7 +250,7 @@ describe('rowSearcher', function() {
250250
var orEqualTo = secondChar === '=';
251251
var trimBy = orEqualTo ? 2 : 1 ;
252252
var compareTo;
253-
253+
254254
if (firstChar === '>') {
255255
compareTo = searchTerm.substr(trimBy) * 1;
256256
return orEqualTo ? rowValue >= compareTo : rowValue > compareTo;

0 commit comments

Comments
 (0)