Skip to content

Commit

Permalink
Supporting keyboard navigation after touching scrollbars without focu…
Browse files Browse the repository at this point in the history
…sing elem
  • Loading branch information
aivopaas authored and vitch committed Apr 3, 2011
1 parent d9ad830 commit 087c952
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions script/jquery.jscrollpane.js
Expand Up @@ -886,7 +886,10 @@

function initKeyboardNav()
{
var keyDown, elementHasScrolled;
var keyDown, elementHasScrolled, validParents = [];
isScrollableH && validParents.push(horizontalBar[0]);
isScrollableV && validParents.push(verticalBar[0]);

// IE also focuses elements that don't have tabindex set.
pane.focus(
function()
Expand All @@ -901,7 +904,7 @@
'keydown.jsp',
function(e)
{
if (e.target !== this){
if (e.target !== this && !(validParents.length && $(e.target).closest(validParents).length)){
return;
}
var dX = horizontalDragPosition, dY = verticalDragPosition;
Expand Down

0 comments on commit 087c952

Please sign in to comment.