Paginator: fix offset

What's `margin` doing here?! It's like this since the first commit, but
it makes no sense... I think I added it incorrectly, being misled by
the getBoundingClientRect bug in Firefox...
This commit is contained in:
John Factotum
2024-09-24 11:36:43 +08:00
parent 59bb647057
commit 329e22227a
-1
View File
@@ -816,7 +816,6 @@ export class Paginator extends HTMLElement {
return this.#scrollTo(offset, reason)
}
const offset = this.#getRectMapper()(rect).left
+ this.#margin / 2
return this.#scrollToPage(Math.floor(offset / this.size) + (this.#rtl ? -1 : 1), reason)
}
async #scrollTo(offset, reason, smooth) {