From 327031aca1c0decf089937310d1622ff5b57c201 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Thu, 12 Sep 2024 05:30:58 +0800 Subject: [PATCH] Paginator: add scroll event Unlike `relocate`, which is debounced, a scroll event is useful when you want to do stuff as soon as it scrolls. --- paginator.js | 1 + 1 file changed, 1 insertion(+) diff --git a/paginator.js b/paginator.js index c87d321..8395438 100644 --- a/paginator.js +++ b/paginator.js @@ -503,6 +503,7 @@ export class Paginator extends HTMLElement { this.#footer = this.#root.getElementById('footer') this.#observer.observe(this.#container) + this.#container.addEventListener('scroll', () => this.dispatchEvent(new Event('scroll'))) this.#container.addEventListener('scroll', debounce(() => { if (this.scrolled) { if (this.#justAnchored) this.#justAnchored = false