diff options
author | Felix Nagel <info@felixnagel.com> | 2010-11-09 23:43:23 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2010-11-09 23:43:23 +0100 |
commit | c6f6b676ebf377cee6234b065f9183c45e929279 (patch) | |
tree | 1dea1e3618673449d92deacf32be44c53fda4c64 | |
parent | 8bf0ec22d9c2c477decb8b386b3bebc0957714dc (diff) | |
download | jquery-ui-c6f6b676ebf377cee6234b065f9183c45e929279.tar.gz jquery-ui-c6f6b676ebf377cee6234b065f9183c45e929279.zip |
fixed: keyboard control, THX to bluefox, see https://github.com/fnagel/jquery-ui/issues#issue/6
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index c75823713..eb5627a73 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -247,8 +247,6 @@ $.widget("ui.selectmenu", { .keydown(function(event){ var ret = true; switch (event.keyCode) { - // FIXME this needs to be fixed as _moveFocus doesnt work correctly - /* case $.ui.keyCode.UP: case $.ui.keyCode.LEFT: ret = false; @@ -259,7 +257,6 @@ $.widget("ui.selectmenu", { ret = false; self._moveFocus(1); break; - */ case $.ui.keyCode.HOME: ret = false; self._moveFocus(':first'); @@ -442,7 +439,7 @@ $.widget("ui.selectmenu", { }, _moveFocus: function(amt){ if(!isNaN(amt)){ - var currIndex = parseInt(this._focusedOptionLi().data('index'), 10); + var currIndex = parseInt(this._focusedOptionLi().data('index') || 0, 10); var newIndex = currIndex + amt; } else { var newIndex = parseInt(this._optionLis.filter(amt).data('index'), 10); } @@ -454,7 +451,7 @@ $.widget("ui.selectmenu", { var activeID = this.widgetBaseClass + '-item-' + Math.round(Math.random() * 1000); this._focusedOptionLi().find('a:eq(0)').attr('id',''); - this._optionLis.eq(newIndex).find('a:eq(0)').attr('id',activeID)[0].focus(); + this._optionLis.eq(newIndex).find('a:eq(0)').attr('id',activeID).focus(); this.list.attr('aria-activedescendant', activeID); }, _scrollPage: function(direction){ |