Skip to content

Commit 5e5be47

Browse files
committed
Fix new lint and flow errors
1 parent 287178e commit 5e5be47

File tree

3 files changed

+1845
-1092
lines changed

3 files changed

+1845
-1092
lines changed

index.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,29 @@ function loadFragment(event: Event) {
9393

9494
function focusOnOpen(details: Element) {
9595
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 = () => {
9999
autofocus(details)
100100
if (details.hasAttribute('open') && !isMouse) {
101101
focusFirstItem(details)
102102
}
103103
}
104104

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)
108108

109109
return {
110110
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)
114114
}
115115
}
116116
}
117117

118-
function closeCurrentMenu(event) {
118+
function closeCurrentMenu(event: Event) {
119119
const el = event.currentTarget
120120
if (!(el instanceof Element)) return
121121
if (!el.hasAttribute('open')) return
@@ -152,9 +152,9 @@ function sibling(details: Element, next: boolean): ?HTMLElement {
152152
)
153153
const selected = document.activeElement
154154
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]
156156
const def = next ? options[0] : options[options.length - 1]
157-
return sibling || def
157+
return found || def
158158
}
159159

160160
const ctrlBindings = navigator.userAgent.match(/Macintosh/)

0 commit comments

Comments
 (0)