Skip to content

Commit eb148aa

Browse files
committed
fix: disable search box auto open, close #99
1 parent 041453d commit eb148aa

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

.vitepress/theme/components/AlgoliaSearchBox.vue

-17
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,8 @@ const { theme, site } = useData()
1414
1515
onMounted(() => {
1616
initialize(theme.value.algolia)
17-
setTimeout(poll, 16)
1817
})
1918
20-
function poll() {
21-
// programmatically open the search box after initialize
22-
const e = new Event('keydown') as any
23-
24-
e.key = 'k'
25-
e.metaKey = true
26-
27-
window.dispatchEvent(e)
28-
29-
setTimeout(() => {
30-
if (!document.querySelector('.DocSearch-Modal')) {
31-
poll()
32-
}
33-
}, 16)
34-
}
35-
3619
// @ts-expect-error
3720
const docsearch$ = docsearch.default ?? docsearch
3821
type DocSearchProps = Parameters<typeof docsearch$>[0]

0 commit comments

Comments
 (0)