File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1010 </ div >
1111
1212 < div >
13- < div class ="main-bar__links-mobile__trigger " onclick ="document.querySelector('#dropdown-trigger-links-mobile').click();document.querySelector('#dropdown-menu-account-mobile').removeAttribute('aria-modal') ">
13+ < div class ="main-bar__links-mobile__trigger " tabindex =" 0 " onClick ="document.querySelector('#dropdown-trigger-links-mobile').click();document.querySelector('#dropdown-menu-account-mobile').removeAttribute('aria-modal') ">
1414 <%= icon "close-line" %>
15+ < p class ="sr-only "> <%= t ( "close" , scope : "decidim.shared.flag_modal" ) %> </ p >
1516 </ div >
1617 </ div >
1718 </ div >
3738 </ ul >
3839 </ div >
3940</ div >
41+ < script type ="text/javascript ">
42+ const closeDiv = document . querySelector ( 'div.main-bar__links-mobile__trigger' ) ;
43+ const menuDropdown = document . querySelector ( '#dropdown-menu-account-mobile' ) ;
44+ const dropdownTrigger = document . querySelector ( '#dropdown-trigger-links-mobile' ) ;
45+ // 32 is code for space bar and 13 is code for enter
46+ closeDiv . addEventListener ( 'keydown' , function ( e ) {
47+ if ( e . keyCode === 13 || e . keyCode === 32 ) {
48+ menuDropdown . removeAttribute ( 'aria-modal' ) ;
49+ menuDropdown . setAttribute ( 'aria-hidden' , "true" ) ;
50+ dropdownTrigger . focus ( ) ;
51+ }
52+ } )
53+ </ script >
You can’t perform that action at this time.
0 commit comments