Reset drawer and search upon back button invocation

This commit is contained in:
squidfunk 2018-03-21 20:21:49 +01:00
parent 65a67b290b
commit bdaf043039
2 changed files with 8 additions and 5 deletions

View File

@ -91,8 +91,8 @@
{% endif %}
</defs>
</svg>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="search" autocomplete="off">
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>
{% if page.toc | first is defined %}
<a href="{{ (page.toc | first).url }}" tabindex="1" class="md-skip">

View File

@ -180,11 +180,14 @@
</defs>
</svg>
<!-- State toggles -->
<!--
State toggles - we need to set autocomplete="off" in order to reset the
drawer on back button invocation in some browsers
-->
<input class="md-toggle" data-md-toggle="drawer"
type="checkbox" id="drawer" />
type="checkbox" id="drawer" autocomplete="off" />
<input class="md-toggle" data-md-toggle="search"
type="checkbox" id="search" />
type="checkbox" id="search" autocomplete="off" />
<!-- Overlay for expanded drawer -->
<label class="md-overlay" data-md-component="overlay" for="drawer"></label>