File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -601,6 +601,22 @@ describe('details-menu element', function () {
601
601
602
602
assert . equal ( input , document . activeElement , 'toggle open focuses on [autofocus]' )
603
603
} )
604
+
605
+ it ( 'summary autofocus should not impact with inner autofocus element' , function ( ) {
606
+ const details = document . querySelector ( 'details' )
607
+ const summary = details . querySelector ( 'summary' )
608
+ const input = details . querySelector ( 'input' )
609
+
610
+ // Summary is the initial element of the entire page, while input is the initial element in the popup
611
+ summary . setAttribute ( 'autofocus' , '' )
612
+
613
+ summary . focus ( )
614
+ details . open = true
615
+ summary . dispatchEvent ( new KeyboardEvent ( 'keydown' , { key : 'Enter' , bubbles : true } ) )
616
+ details . dispatchEvent ( new CustomEvent ( 'toggle' ) )
617
+
618
+ assert . equal ( document . activeElement , input , 'toggle open focuses on [autofocus]' )
619
+ } )
604
620
} )
605
621
606
622
describe ( 'closing the menu' , function ( ) {
You can’t perform that action at this time.
0 commit comments