Don't snap on taps that never panned

A tap goes through #onTouchEnd's snap, which emits a no-op
relocate; readers treat any relocate as a page turn and dismiss
popovers, so the highlight edit popover opened by the tap's
synthetic click was immediately hidden.
This commit is contained in:
John O'Keefe
2026-09-15 12:56:08 -04:00
parent f872a01d53
commit 422e8e0ec0
+5
View File
@@ -994,8 +994,13 @@ export class Paginator extends HTMLElement {
this.scrollBy(dx, dy)
}
#onTouchEnd() {
const wasScrolled = this.#touchScrolled
this.#touchScrolled = false
if (this.scrolled || this.#touchSelActive) return
// A touch that never panned (a tap) is already page-aligned;
// snapping anyway emits a no-op relocate, which readers treat
// as a page turn (e.g. dismissing a just-opened popover).
if (!wasScrolled) return
// XXX: Firefox seems to report scale as 1... sometimes...?
// at this point I'm basically throwing `requestAnimationFrame` at