Fixed invisible back-to-top button being focusable

This commit is contained in:
squidfunk 2021-09-19 15:27:46 +02:00
parent 3c352bd356
commit 60a007844c
4 changed files with 15 additions and 10 deletions

View File

@ -223,7 +223,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.527e4d51.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.48dfec6c.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}

View File

@ -40,8 +40,10 @@ import {
import {
resetBackToTopOffset,
resetBackToTopState,
resetFocusable,
setBackToTopOffset,
setBackToTopState
setBackToTopState,
setFocusable
} from "~/actions"
import { Viewport, setElementFocus } from "~/browser"
@ -156,8 +158,10 @@ export function mountBackToTop(
if (hidden) {
setBackToTopState(el, "hidden")
setElementFocus(el, false)
setFocusable(el, -1)
} else {
resetBackToTopState(el)
resetFocusable(el)
}
},
@ -165,6 +169,7 @@ export function mountBackToTop(
complete() {
resetBackToTopOffset(el)
resetBackToTopState(el)
resetFocusable(el)
}
})