File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,19 @@ export function initNav() {
50
50
51
51
const pagesDropdown = $ ( '#pages-dropdown' )
52
52
if ( pagesDropdown ) {
53
- const activeAnchor = $ ( 'a.pages-dropdown_active' , pagesDropdown )
54
- activeAnchor ?. addEventListener ( 'mousedown' , ( e ) => {
55
- e . preventDefault ( )
53
+ const anchors = $$ ( 'a' , pagesDropdown )
54
+ anchors . forEach ( ( a ) => {
55
+ a . addEventListener ( 'mousedown' , ( e ) => {
56
+ e . preventDefault ( )
57
+ } )
58
+ a . addEventListener ( 'mouseup' , ( ) => {
59
+ if ( document . activeElement instanceof HTMLElement ) {
60
+ document . activeElement . blur ( )
61
+ }
62
+ } )
56
63
} )
57
64
}
58
65
59
- const allNavItems = $$ ( 'a' , pagesNav )
60
- allNavItems . forEach ( ( link ) => {
61
- link . addEventListener ( 'click' , ( ) => {
62
- link . closest ( 'details' ) . removeAttribute ( 'open' )
63
- } )
64
- } )
65
-
66
66
const navItems = $$ (
67
67
'a[href="' +
68
68
window . location . pathname +
Original file line number Diff line number Diff line change 7
7
@if (Model .IsPrimaryNavEnabled && current is { Group .Index : not null })
8
8
{
9
9
<div class =" sticky top-0 py-6 bg-white z-10 border-b-1 border-grey-20 pr-4" >
10
- <div id =" pages-dropdown" class =" block group border-1 border-grey-20 rounded-sm font-sans relative" >
10
+ <div tabindex = " 0 " id =" pages-dropdown" class =" block group border-1 border-grey-20 rounded-sm font-sans relative" >
11
11
<button class =" w-full text-left grid grid-cols-[1fr_auto] cursor-pointer font-semibold gap-1 hover:text-black pl-4 pr-2 py-2 group-open:border-b-1 border-grey-20" >
12
12
<div >
13
13
<a
You can’t perform that action at this time.
0 commit comments