Skip to content

Commit

Permalink
fix(cellnav): when grid has only one focusable column, should navigat…
Browse files Browse the repository at this point in the history
…e up and down
  • Loading branch information
sglogowski committed Oct 16, 2016
1 parent eec9067 commit d3801ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/features/cellnav/js/cellnav.js
Expand Up @@ -128,7 +128,7 @@
var nextColIndex = curColIndex === 0 ? focusableCols.length - 1 : curColIndex - 1;

//get column to left
if (nextColIndex > curColIndex) {
if (nextColIndex >= curColIndex) {
// On the first row
// if (curRowIndex === 0 && curColIndex === 0) {
// return null;
Expand Down Expand Up @@ -160,7 +160,7 @@
}
var nextColIndex = curColIndex === focusableCols.length - 1 ? 0 : curColIndex + 1;

if (nextColIndex < curColIndex) {
if (nextColIndex <= curColIndex) {
if (curRowIndex === focusableRows.length - 1) {
return new GridRowColumn(curRow, focusableCols[nextColIndex]); //return same row
}
Expand Down

0 comments on commit d3801ba

Please sign in to comment.