Improved back-to-top button during fast scrolling

This commit is contained in:
squidfunk
2022-06-05 13:49:03 +02:00
parent a2ccd7327a
commit f1cfe4c07f
10 changed files with 18 additions and 13 deletions

View File

@@ -139,7 +139,7 @@ export function mountBackToTop(
/* Handle emission */
next({ hidden }) {
el.classList.toggle("md-top--hidden", hidden)
el.hidden = hidden
if (hidden) {
el.setAttribute("tabindex", "-1")
el.blur()
@@ -151,7 +151,7 @@ export function mountBackToTop(
/* Handle complete */
complete() {
el.style.top = ""
el.classList.add("md-top--hidden")
el.hidden = true
el.removeAttribute("tabindex")
}
})