Skip to content

Commit

Permalink
Merge pull request angular-ui#5744 from sglogowski/fix-cell-navigatio…
Browse files Browse the repository at this point in the history
…ns-when-only-one-column-is-focusable

fix(cellnav): when grid has only one focusable column, should navigat…
  • Loading branch information
dlgski authored Nov 9, 2016
2 parents 34a7ac6 + d3801ba commit 9849b83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/features/cellnav/js/cellnav.js
Original file line number Diff line number Diff line change
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 9849b83

Please sign in to comment.