@@ -132,9 +132,14 @@ $.widget("ui.selectmenu", {
132
132
case $ . ui . keyCode . TAB :
133
133
ret = true ;
134
134
break ;
135
+ case $ . ui . keyCode . PAGE_UP :
135
136
case $ . ui . keyCode . HOME :
136
137
self . index ( 0 ) ;
137
138
break ;
139
+ case $ . ui . keyCode . PAGE_DOWN :
140
+ case $ . ui . keyCode . END :
141
+ self . index ( self . _optionLis . length ) ;
142
+ break ;
138
143
default :
139
144
ret = true ;
140
145
}
@@ -146,15 +151,17 @@ $.widget("ui.selectmenu", {
146
151
}
147
152
return true ;
148
153
} )
149
- . bind ( 'mouseover.selectmenu focus.selectmenu' , function ( ) {
150
- if ( ! o . disabled ) {
151
- $ ( this ) . addClass ( self . widgetBaseClass + '-focus ui-state-hover' ) ;
152
- }
154
+ . bind ( 'mouseover.selectmenu' , function ( ) {
155
+ if ( ! o . disabled ) $ ( this ) . addClass ( 'ui-state-hover' ) ;
153
156
} )
154
- . bind ( 'mouseout.selectmenu blur.selectmenu' , function ( ) {
155
- if ( ! o . disabled ) {
156
- $ ( this ) . removeClass ( self . widgetBaseClass + '-focus ui-state-hover' ) ;
157
- }
157
+ . bind ( 'mouseout.selectmenu' , function ( ) {
158
+ if ( ! o . disabled ) $ ( this ) . removeClass ( 'ui-state-hover' ) ;
159
+ } )
160
+ . bind ( 'focus.selectmenu' , function ( ) {
161
+ if ( ! o . disabled ) $ ( this ) . addClass ( 'ui-state-focus' ) ;
162
+ } )
163
+ . bind ( 'blur.selectmenu' , function ( ) {
164
+ if ( ! o . disabled ) $ ( this ) . removeClass ( 'ui-state-focus' ) ;
158
165
} ) ;
159
166
160
167
// document click closes menu
@@ -437,6 +444,9 @@ $.widget("ui.selectmenu", {
437
444
438
445
// update value
439
446
this . index ( this . _selectedIndex ( ) ) ;
447
+
448
+ // set selected item so movefocus has intial state
449
+ this . _selectedOptionLi ( ) . addClass ( this . widgetBaseClass + '-item-focus' ) ;
440
450
441
451
// needed when selectmenu is placed at the very bottom / top of the page
442
452
window . setTimeout ( function ( ) {
@@ -665,7 +675,7 @@ $.widget("ui.selectmenu", {
665
675
( amt > 0 ) ? ++ amt : -- amt ;
666
676
this . _moveSelection ( amt , newIndex ) ;
667
677
} else {
668
- return this . _optionLis . eq ( newIndex ) . trigger ( 'mouseup' ) ;
678
+ this . _optionLis . eq ( newIndex ) . trigger ( 'mouseover' ) . trigger ( 'mouseup' ) ;
669
679
}
670
680
}
671
681
} ,
0 commit comments