johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
6.45k stars 298 forks source link

Wrong chapter selected in sidebar when displaying first page of chapter #229

Closed touchscreenuser closed 4 years ago

touchscreenuser commented 4 years ago

When selecting a chapter in sidebar Foliate displays the correct page in text pane but the sidebar highlights the chapter before the selected chapter (doesn't happen for first chapter). When turning page to 2nd page of chapter correct chapter is selected in sidebar, when turning page back to 1st page error re-appears. Same when turning page backwards.

Arch Linux and Cinnamon desktop running Foliate master branch 2.0.0.

johnfactotum commented 4 years ago

Does it display the correct chapter name in the footer? If so then this is probably expected behavior. The chapter selected in the sidebar is the location at the start of the displayed page, which may sometimes be the previous section if multiple sections are contained in a single spine item. If not, can you enable developer tools and provide the output of book.navigation.toc?

touchscreenuser commented 4 years ago

You are right the footer displays the correct chapter name.

touchscreenuser commented 4 years ago

Tried some other books here the behaviour is correct. Seems to be a problem of the ebook I tested in the first place.