mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-22 22:03:35 -04:00
Keep search open on enter without selection
This commit is contained in:
committed by
Martin Donath
parent
a267729084
commit
253596c58d
@@ -290,13 +290,14 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
/* Go to current active/focused link */
|
||||
const focus = document.querySelector(
|
||||
"[data-md-component=search] [href][data-md-state=active]")
|
||||
if (focus instanceof HTMLLinkElement)
|
||||
if (focus instanceof HTMLLinkElement) {
|
||||
window.location = focus.getAttribute("href")
|
||||
|
||||
/* Close search */
|
||||
toggle.checked = false
|
||||
toggle.dispatchEvent(new CustomEvent("change"))
|
||||
query.blur()
|
||||
/* Close search */
|
||||
toggle.checked = false
|
||||
toggle.dispatchEvent(new CustomEvent("change"))
|
||||
query.blur()
|
||||
}
|
||||
}
|
||||
|
||||
/* Escape: close search */
|
||||
|
||||
Reference in New Issue
Block a user