Skip to content

Commit e32a5c5

Browse files
committed
use dropdown API to get current cursor to focus in search script
1 parent 574942c commit e32a5c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/js/vendor/docsearch.bundle.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
input.on('autocomplete:updated', resetScroll.bind(autocomplete.getWrapper().firstChild))
4242
typeahead.dropdown._ensureVisible = ensureVisible
4343
if (filterInput) filterInput.addEventListener('change', toggleFilter.bind(typeahead))
44-
monitorCtrlKey(input, typeahead.dropdown.$menu)
44+
monitorCtrlKey(input, typeahead.dropdown)
4545
searchField.addEventListener('click', confineEvent)
4646
document.documentElement.addEventListener('click', resetSearch.bind(autocomplete))
4747
document.addEventListener('keydown', handleShortcuts.bind(input))
@@ -103,11 +103,11 @@
103103

104104
function monitorCtrlKey (input, dropdown) {
105105
input.on('keydown', onCtrlKeyDown.bind(dropdown))
106-
dropdown.on('keyup', onCtrlKeyUp.bind(input))
106+
dropdown.$container.on('keyup', onCtrlKeyUp.bind(input))
107107
}
108108

109109
function onCtrlKeyDown (e) {
110-
if (e.keyCode === CTRL_KEY) this.find('.ds-cursor a').focus()
110+
if (e.keyCode === CTRL_KEY) this.getCurrentCursor().find('a').focus()
111111
}
112112

113113
function onCtrlKeyUp (e) {

0 commit comments

Comments
 (0)