@@ -93,29 +93,29 @@ function loadFragment(event: Event) {
93
93
94
94
function focusOnOpen ( details : Element ) {
95
95
let isMouse = false
96
- const mousedown = ( ) => ( isMouse = true )
97
- const keydown = ( ) => ( isMouse = false )
98
- const toggle = ( ) => {
96
+ const onmousedown = ( ) => ( isMouse = true )
97
+ const onkeydown = ( ) => ( isMouse = false )
98
+ const ontoggle = ( ) => {
99
99
autofocus ( details )
100
100
if ( details . hasAttribute ( 'open' ) && ! isMouse ) {
101
101
focusFirstItem ( details )
102
102
}
103
103
}
104
104
105
- details . addEventListener ( 'mousedown' , mousedown )
106
- details . addEventListener ( 'keydown' , keydown )
107
- details . addEventListener ( 'toggle' , toggle )
105
+ details . addEventListener ( 'mousedown' , onmousedown )
106
+ details . addEventListener ( 'keydown' , onkeydown )
107
+ details . addEventListener ( 'toggle' , ontoggle )
108
108
109
109
return {
110
110
unsubscribe : ( ) => {
111
- details . removeEventListener ( 'mousedown' , mousedown )
112
- details . removeEventListener ( 'keydown' , keydown )
113
- details . removeEventListener ( 'toggle' , toggle )
111
+ details . removeEventListener ( 'mousedown' , onmousedown )
112
+ details . removeEventListener ( 'keydown' , onkeydown )
113
+ details . removeEventListener ( 'toggle' , ontoggle )
114
114
}
115
115
}
116
116
}
117
117
118
- function closeCurrentMenu ( event ) {
118
+ function closeCurrentMenu ( event : Event ) {
119
119
const el = event . currentTarget
120
120
if ( ! ( el instanceof Element ) ) return
121
121
if ( ! el . hasAttribute ( 'open' ) ) return
@@ -152,9 +152,9 @@ function sibling(details: Element, next: boolean): ?HTMLElement {
152
152
)
153
153
const selected = document . activeElement
154
154
const index = options . indexOf ( selected )
155
- const sibling = next ? options [ index + 1 ] : options [ index - 1 ]
155
+ const found = next ? options [ index + 1 ] : options [ index - 1 ]
156
156
const def = next ? options [ 0 ] : options [ options . length - 1 ]
157
- return sibling || def
157
+ return found || def
158
158
}
159
159
160
160
const ctrlBindings = navigator . userAgent . match ( / M a c i n t o s h / )
0 commit comments