mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-30 23:49:10 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user