.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;
ret = false;
self._moveFocus(1);
break;
- */
case $.ui.keyCode.HOME:
ret = false;
self._moveFocus(':first');
},
_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); }
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){