File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -45,4 +45,17 @@ asyncTest( "#9044: Autofocus issue with dialog opened from menu widget", functio
45
45
} ) ;
46
46
} ) ;
47
47
48
+ asyncTest ( "#9532: Need a way in Menu to keep ui-state-active class on selected item for Selectmenu" , function ( ) {
49
+ expect ( 1 ) ;
50
+ var element = $ ( "#menu1" ) . menu ( ) ,
51
+ firstChild = element . children ( ) . eq ( 0 ) ;
52
+
53
+ element . menu ( "focus" , null , firstChild ) ;
54
+ firstChild . addClass ( "ui-state-active" ) ;
55
+ setTimeout ( function ( ) {
56
+ ok ( firstChild . is ( ".ui-state-active" ) , "ui-state-active improperly removed" ) ;
57
+ start ( ) ;
58
+ } , 500 ) ;
59
+ } ) ;
60
+
48
61
} ) ( jQuery ) ;
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ $.widget( "ui.menu", {
371
371
this . _scrollIntoView ( item ) ;
372
372
373
373
this . active = item . first ( ) ;
374
- focused = this . active . addClass ( "ui-state-focus" ) ;
374
+ focused = this . active . addClass ( "ui-state-focus" ) . removeClass ( "ui-state-active" ) ;
375
375
// Only update aria-activedescendant if there's a role
376
376
// otherwise we assume focus is managed elsewhere
377
377
if ( this . options . role ) {
@@ -498,7 +498,7 @@ $.widget( "ui.menu", {
498
498
. attr ( "aria-hidden" , "true" )
499
499
. attr ( "aria-expanded" , "false" )
500
500
. end ( )
501
- . find ( ".ui-state-active" )
501
+ . find ( ".ui-state-active" ) . not ( ".ui-state-focus" )
502
502
. removeClass ( "ui-state-active" ) ;
503
503
} ,
504
504
You can’t perform that action at this time.
0 commit comments