@@ -172,8 +172,10 @@ $.widget( "ui.selectmenu", {
172
172
173
173
that . close ( event , true ) ;
174
174
} ,
175
- focus : function ( event , ui ) {
176
- that . _trigger ( "focus" , event , { item : ui . item . data ( "item.selectmenu" ) } ) ;
175
+ focus : function ( event , ui ) {
176
+ var item = ui . item . data ( "item.selectmenu" ) ;
177
+ if ( that . focus !== undefined && item . index != that . focus ) that . _trigger ( "focus" , event , { item : item } ) ;
178
+ that . focus = item . index ;
177
179
}
178
180
} ) ;
179
181
} ,
@@ -302,15 +304,9 @@ $.widget( "ui.selectmenu", {
302
304
} ,
303
305
304
306
_move : function ( key , event ) {
305
- // TODO this focus is needed to make the select below work,
306
- // but should be removed as its fires an unwanted focus event
307
- if ( ! this . opened ) {
308
- this . list . menu ( "focus" , event , this . _getSelectedItem ( ) ) ;
309
- }
307
+ if ( ! this . opened ) this . list . menu ( "focus" , event , this . _getSelectedItem ( ) ) ;
310
308
this . list . menu ( key , event ) ;
311
- if ( ! this . opened ) {
312
- this . list . menu ( "select" , event ) ;
313
- }
309
+ if ( ! this . opened ) this . list . menu ( "select" , event ) ;
314
310
} ,
315
311
316
312
_getSelectedItem : function ( ) {
0 commit comments