From 02b05cae6d5385e01d00f812662f16009130c647 Mon Sep 17 00:00:00 2001 From: swalters Date: Tue, 21 Apr 2015 16:25:17 -0500 Subject: [PATCH] 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 --- src/features/cellnav/js/cellnav.js | 4 +++- test/unit/core/row-filtering.spec.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/features/cellnav/js/cellnav.js b/src/features/cellnav/js/cellnav.js index a0038b0d23..9d0047ce1d 100644 --- a/src/features/cellnav/js/cellnav.js +++ b/src/features/cellnav/js/cellnav.js @@ -515,7 +515,9 @@ var rowCol = { row: gridRow, col: gridCol }; // Broadcast the navigation - grid.cellNav.broadcastCellNav(rowCol); + if (gridRow !== null && gridCol !== null) { + grid.cellNav.broadcastCellNav(rowCol); + } }); diff --git a/test/unit/core/row-filtering.spec.js b/test/unit/core/row-filtering.spec.js index 4808592f29..30b47876a9 100644 --- a/test/unit/core/row-filtering.spec.js +++ b/test/unit/core/row-filtering.spec.js @@ -51,7 +51,7 @@ describe('rowSearcher', function() { }); describe('guessCondition', function () { - iit('should create a RegExp when term ends with a *', function() { + it('should create a RegExp when term ends with a *', function() { var filter = { term: 'blah*' }; var re = new RegExp(/^blah[\s\S]*?$/i); @@ -236,7 +236,7 @@ describe('rowSearcher', function() { expect(ret.length).toEqual(3); }); }); - + describe('with a custom filter function', function() { var custom, ret; beforeEach(function() { @@ -250,7 +250,7 @@ describe('rowSearcher', function() { var orEqualTo = secondChar === '='; var trimBy = orEqualTo ? 2 : 1 ; var compareTo; - + if (firstChar === '>') { compareTo = searchTerm.substr(trimBy) * 1; return orEqualTo ? rowValue >= compareTo : rowValue > compareTo;