I encountered this when trying to use https://github.com/edrlab/thorium-web and I don't know how to easily test it from this repository directly, but from what I can tell the root cause is from here.
To reproduce:
- Monitor
canGoForward from EpubNavigator in some way (I did this in Thorium by adding a log statement in the wrapper function defined in useEpubNavigator).
- Open "Bella The Dragon" (included in the list of example e-books in Thorium).
- Progress through the book and monitor the value of
canGoForward. Starting on page 15 (half-way through the book), it will start evaluating to false.
This seems to have to do with how FXLSpreader works, since it builds spreads in groups of two pages, but then identifies the current spread based on the page index in the spreads list. In landscape mode perPage is 2 which accounts for the fact that the page index is twice as large as the spread index, but in portrait mode perPage is 1. The (incorrect) current spread is then used by FXLFramePoolManager to build the viewport progressions list, which is in turn used to calculate canGoForward.
I encountered this when trying to use https://github.com/edrlab/thorium-web and I don't know how to easily test it from this repository directly, but from what I can tell the root cause is from here.
To reproduce:
canGoForwardfromEpubNavigatorin some way (I did this in Thorium by adding a log statement in the wrapper function defined inuseEpubNavigator).canGoForward. Starting on page 15 (half-way through the book), it will start evaluating to false.This seems to have to do with how
FXLSpreaderworks, since it builds spreads in groups of two pages, but then identifies the current spread based on the page index in the spreads list. In landscape modeperPageis 2 which accounts for the fact that the page index is twice as large as the spread index, but in portrait modeperPageis 1. The (incorrect) current spread is then used byFXLFramePoolManagerto build the viewport progressions list, which is in turn used to calculatecanGoForward.