1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-30 18:24:35 +01:00

Fixed search not closing after navigation

This commit is contained in:
squidfunk 2021-02-22 22:32:00 +01:00
parent ece3253d4f
commit f27eb1ee07
5 changed files with 19 additions and 12 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -217,7 +217,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.b83fae36.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.926459b3.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}

View File

@ -23,6 +23,7 @@
import "focus-visible"
import { Subject, defer, merge } from "rxjs"
import {
delay,
filter,
map,
mergeWith,
@ -96,9 +97,15 @@ setupClipboardJS({ alert$ })
if (feature("navigation.instant"))
setupInstantLoading({ document$, location$, viewport$ })
/* Always close drawer on navigation */
/* Always close drawer and search on navigation */
merge(location$, target$)
.subscribe(() => setToggle("drawer", false))
.pipe(
delay(125)
)
.subscribe(() => {
setToggle("drawer", false)
setToggle("search", false)
})
/* Set up global keyboard handlers */
keyboard$