Skip to content

Commit

Permalink
Paginator: add scroll event
Browse files Browse the repository at this point in the history
Unlike `relocate`, which is debounced, a scroll event is useful when you
want to do stuff as soon as it scrolls.
  • Loading branch information
johnfactotum committed Sep 11, 2024
1 parent 3658b19 commit 327031a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions paginator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 327031a

Please sign in to comment.