From 887138472beea17302a32c775774a91cb7203e4a Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Wed, 17 May 2023 12:49:23 +0800 Subject: [PATCH] Fix visible range --- paginator.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/paginator.js b/paginator.js index 9f3954c..99e1d82 100644 --- a/paginator.js +++ b/paginator.js @@ -663,8 +663,11 @@ export class Paginator extends HTMLElement { } } #getVisibleRange() { + if (this.scrolled) return getVisibleRange(this.#view.document, + this.start, this.end, this.#getRectMapper()) + const { size } = this return getVisibleRange(this.#view.document, - this.start, this.end, this.#getRectMapper(), this.scrolled) + this.start - size, this.end - size, this.#getRectMapper()) } #afterScroll(reason) { const range = this.#getVisibleRange()