Paginator: fix scroll offset when tabbing

This commit is contained in:
John Factotum
2024-09-14 23:14:04 +08:00
parent b5d0453004
commit 3b96ddf3e6
+4
View File
@@ -519,6 +519,10 @@ export class Paginator extends HTMLElement {
doc.addEventListener('touchstart', this.#onTouchStart.bind(this), opts) doc.addEventListener('touchstart', this.#onTouchStart.bind(this), opts)
doc.addEventListener('touchmove', this.#onTouchMove.bind(this), opts) doc.addEventListener('touchmove', this.#onTouchMove.bind(this), opts)
doc.addEventListener('touchend', this.#onTouchEnd.bind(this)) doc.addEventListener('touchend', this.#onTouchEnd.bind(this))
doc.addEventListener('focusin', e =>
// NOTE: `requestAnimationFrame` is needed in WebKit
requestAnimationFrame(() => this.scrollToAnchor(e.target)))
}) })
this.#mediaQueryListener = () => { this.#mediaQueryListener = () => {