@@ -573,25 +573,28 @@ $.widget("ui.selectmenu", {
573
573
} ,
574
574
575
575
_moveSelection : function ( amt , recIndex ) {
576
- var currIndex = parseInt ( this . _selectedOptionLi ( ) . data ( 'index' ) || 0 , 10 ) ;
577
- var newIndex = currIndex + amt ;
578
- // do not loop when using up key
576
+ // do nothing if disabled
577
+ if ( ! this . options . disabled ) {
578
+ var currIndex = parseInt ( this . _selectedOptionLi ( ) . data ( 'index' ) || 0 , 10 ) ;
579
+ var newIndex = currIndex + amt ;
580
+ // do not loop when using up key
579
581
580
- if ( newIndex < 0 ) {
581
- newIndex = 0 ;
582
- }
583
- if ( newIndex > this . _optionLis . size ( ) - 1 ) {
584
- newIndex = this . _optionLis . size ( ) - 1 ;
585
- }
586
- // Occurs when a full loop has been made
587
- if ( newIndex === recIndex ) { return false ; }
582
+ if ( newIndex < 0 ) {
583
+ newIndex = 0 ;
584
+ }
585
+ if ( newIndex > this . _optionLis . size ( ) - 1 ) {
586
+ newIndex = this . _optionLis . size ( ) - 1 ;
587
+ }
588
+ // Occurs when a full loop has been made
589
+ if ( newIndex === recIndex ) { return false ; }
588
590
589
- if ( this . _optionLis . eq ( newIndex ) . hasClass ( this . namespace + '-state-disabled' ) ) {
590
- // if option at newIndex is disabled, call _moveFocus, incrementing amt by one
591
- ( amt > 0 ) ? ++ amt : -- amt ;
592
- this . _moveSelection ( amt , newIndex ) ;
593
- } else {
594
- return this . _optionLis . eq ( newIndex ) . trigger ( 'mouseup' ) ;
591
+ if ( this . _optionLis . eq ( newIndex ) . hasClass ( this . namespace + '-state-disabled' ) ) {
592
+ // if option at newIndex is disabled, call _moveFocus, incrementing amt by one
593
+ ( amt > 0 ) ? ++ amt : -- amt ;
594
+ this . _moveSelection ( amt , newIndex ) ;
595
+ } else {
596
+ return this . _optionLis . eq ( newIndex ) . trigger ( 'mouseup' ) ;
597
+ }
595
598
}
596
599
} ,
597
600
0 commit comments