Hi.
I’m using foliate-view in a web reader and ran into an issue distinguishing native mobile swipe page turns from other relocation events.
For button/programmatic navigation, I can call view.next() / view.prev(), so my app knows the intended direction, and Foliate relocates with reason: "page".
For native touch pagination, Foliate handles the gesture internally:
touchend -> snap(vx, vy) -> #scrollToPage(page, "snap")
The consumer then sees relocate events with reason: "snap" and sometimes follow-up reason: "anchor" events. From the public event data, it is hard to tell whether the snap represented:
- a forward page turn
- a backward page turn
- settling back onto the same page
- a non-reading/layout relocation
Would you consider exposing consistent page-turn metadata for native swipe pagination, either on the relocate.detail for reason: "snap" or as a separate event?
For example:
{
reason: "snap",
direction: "next" | "prev" | "none",
fromPage,
toPage,
pages,
index
}
Hi.
I’m using
foliate-viewin a web reader and ran into an issue distinguishing native mobile swipe page turns from other relocation events.For button/programmatic navigation, I can call
view.next()/view.prev(), so my app knows the intended direction, and Foliate relocates withreason: "page".For native touch pagination, Foliate handles the gesture internally:
touchend -> snap(vx, vy) -> #scrollToPage(page, "snap")The consumer then sees
relocateevents withreason: "snap"and sometimes follow-upreason: "anchor"events. From the public event data, it is hard to tell whether the snap represented:Would you consider exposing consistent page-turn metadata for native swipe pagination, either on the
relocate.detailforreason: "snap"or as a separate event?For example: