Skip to content

Commit e4d6bee

Browse files
committed
fix focus of search box on home page
1 parent fb56455 commit e4d6bee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/js/vendor/docsearch.bundle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
apiKey: config.apiKey,
1515
indexName: config.indexName,
1616
inputSelector: searchFieldSelector + ' .query',
17-
autocompleteOptions: { debug: true, hint: false, keyboardShortcuts: ['s'], minLength: 2 },
17+
autocompleteOptions: { autoselect: true, debug: true, hint: false, keyboardShortcuts: ['s'], minLength: 2 },
1818
algoliaOptions: algoliaOptions,
1919
queryHook:
2020
filterInput &&
@@ -30,7 +30,7 @@
3030
if (filterInput) filterInput.addEventListener('change', toggleFilter.bind(controller.input))
3131
searchField.addEventListener('click', confineEvent)
3232
document.documentElement.addEventListener('click', resetSearch.bind(autocomplete))
33-
if (controller.input.attr('autofocus')) controller.input.focus()
33+
if (controller.input.attr('autofocus') != null) controller.input.focus()
3434
}
3535

3636
function appendStylesheet (href) {

0 commit comments

Comments
 (0)