Skip to content

Commit

Permalink
Fix issue dojo#1043
Browse files Browse the repository at this point in the history
  • Loading branch information
allencblee committed Nov 30, 2014
1 parent c54e2fc commit 567608b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@ define([

var isFocusableClass = this.cellNavigation ? hasGridCellClass : hasGridRowClass;
if (!inputFocused && isFocusableClass.test(element.className)) {
var scroll = this.getScrollPosition(),
row = this.row(element).element;
if(scroll.y > row.offsetTop) { // element is above the viewport
this.scrollTo({x: scroll.x, y: row.offsetTop});
} else if ((scroll.y + this.bodyNode.clientHeight) <= row.offsetTop) { // element is below the viewport
this.scrollTo({x: scroll.x, y: row.offsetTop - this.bodyNode.clientHeight + row.clientHeight});
}
element.tabIndex = this.tabIndex;
element.focus();
}
Expand Down Expand Up @@ -535,4 +542,4 @@ define([
};

return Keyboard;
});
});

0 comments on commit 567608b

Please sign in to comment.