Skip to content

Commit 34afa85

Browse files
committed
Fix JS failures
1 parent 541bda8 commit 34afa85

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

Diff for: assets/js/autocomplete/autocomplete-list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export function togglePreview () {
147147
export function hidePreview () {
148148
state.previewOpen = false
149149
const suggestionList = qs(AUTOCOMPLETE_SUGGESTION_LIST_SELECTOR)
150-
suggestionList.classList.remove('previewing')
150+
if(suggestionList) { suggestionList.classList.remove('previewing') }
151151
removePreview()
152152
}
153153

Diff for: assets/js/search-bar.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,19 @@ function addEventListeners () {
9999

100100
searchInput.addEventListener('blur', event => {
101101
const relatedTarget = event.relatedTarget
102+
const suggestionList = qs(AUTOCOMPLETE_SUGGESTION_LIST_SELECTOR)
102103

103-
if (relatedTarget) {
104+
if (relatedTarget && suggestionList && suggestionList.contains(relatedTarget)) {
104105
// If blur is triggered caused by clicking on an autocomplete result,
105106
// then ignore it, because it's handled in the click handler below.
106-
if (qs(AUTOCOMPLETE_SUGGESTION_LIST_SELECTOR).contains(relatedTarget)) {
107+
setTimeout(() => {
107108
// Focus the input after a while, so that it's easier to close
108109
// or get back to after an accidental blur
109-
setTimeout(() => {
110-
if (isAutocompleteListOpen()) {
111-
searchInput.focus()
112-
}
113-
}, 1000)
114-
return null
115-
} else {
116-
hideAutocomplete()
117-
}
110+
if (isAutocompleteListOpen()) {
111+
searchInput.focus()
112+
}
113+
}, 1000)
114+
return null
118115
} else {
119116
hideAutocomplete()
120117
}

Diff for: formatters/html/dist/html-3RF7LI4Z.js renamed to formatters/html/dist/html-GXQ6W6IF.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)