File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,6 @@ $.widget( "ui.selectmenu", {
155
155
156
156
// Set ARIA active decendent
157
157
that . button . attr ( "aria-activedescendant" , that . menuItems . eq ( item . index ) . find ( "a" ) . attr ( "id" ) ) ;
158
-
159
158
} ,
160
159
// set ARIA role
161
160
role : 'listbox'
@@ -233,6 +232,7 @@ $.widget( "ui.selectmenu", {
233
232
if ( this . isOpen ) {
234
233
this . isOpen = false ;
235
234
this . _toggleAttr ( ) ;
235
+ this . button . attr ( "aria-activedescendant" , this . _getSelectedItem ( ) . find ( "a" ) . attr ( "id" ) ) ;
236
236
this . _trigger ( "close" , event ) ;
237
237
}
238
238
} ,
@@ -376,16 +376,12 @@ $.widget( "ui.selectmenu", {
376
376
} ,
377
377
378
378
_setSelected : function ( item ) {
379
- var itemId = this . menuItems . eq ( item . index ) . find ( "a" ) . attr ( "id" ) ;
380
379
// update button text
381
380
this . buttonText . html ( item . label ) ;
382
381
// change ARIA attr
383
382
this . menuItems . find ( "a" ) . attr ( "aria-selected" , false ) ;
384
383
this . _getSelectedItem ( ) . find ( "a" ) . attr ( "aria-selected" , true ) ;
385
- this . button . attr ( {
386
- "aria-activedescendant" : itemId ,
387
- "aria-labelledby" : itemId
388
- } ) ;
384
+ this . button . attr ( "aria-labelledby" , this . menuItems . eq ( item . index ) . find ( "a" ) . attr ( "id" ) ) ;
389
385
} ,
390
386
391
387
_setOption : function ( key , value ) {
You can’t perform that action at this time.
0 commit comments