Skip to content

Commit

Permalink
fix(cellNav): fix null ref issue in navigate event for oldRowColumn
Browse files Browse the repository at this point in the history
 scrollTo should not setFocus unless there is an active row and column. Was getting error when using restoreState
  • Loading branch information
swalters committed Apr 21, 2015
1 parent 89461bc commit 02b05ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/features/cellnav/js/cellnav.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});


Expand Down
6 changes: 3 additions & 3 deletions test/unit/core/row-filtering.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -236,7 +236,7 @@ describe('rowSearcher', function() {
expect(ret.length).toEqual(3);
});
});

describe('with a custom filter function', function() {
var custom, ret;
beforeEach(function() {
Expand All @@ -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;
Expand Down

0 comments on commit 02b05ca

Please sign in to comment.