epubjs-rn icon indicating copy to clipboard operation
epubjs-rn copied to clipboard

Selecting/scrolling to first page of chapter causing jump to end of chapter

Open ErnestGrey opened this issue 4 years ago • 2 comments

So I am not sure if this is a bug, but I am having an issue with the reader jumping to the end of the chapter. It's happening in two instances.

  1. Chapter selection - I am using the onReady function to return me the book, I am then finding all the toc objects and creating a chapter menu drawer. When I select a chapter it updates the location using the chapter href (i.e chapter_008.xhtml) and it navigates to the chapter for a split second and then jumps to the last page of the chapter (chapter 8 in this example).

  2. Scrolling to the first page of a chapter - Same set up as above. For example, if I select chapter 8 from the menu, it navigates to chapter 8, then quickly jumps to the last page of that chapter. Then if I scroll forward to chapter 9, once the swipe is complete it then jumps to the last page of chapter 9.

Anyone else coming across this issue?

ErnestGrey avatar Sep 10 '20 20:09 ErnestGrey

So I am not sure if this is a bug, but I am having an issue with the reader jumping to the end of the chapter. It's happening in two instances.

  1. Chapter selection - I am using the onReady function to return me the book, I am then finding all the toc objects and creating a chapter menu drawer. When I select a chapter it updates the location using the chapter href (i.e chapter_008.xhtml) and it navigates to the chapter for a split second and then jumps to the last page of the chapter (chapter 8 in this example).
  2. Scrolling to the first page of a chapter - Same set up as above. For example, if I select chapter 8 from the menu, it navigates to chapter 8, then quickly jumps to the last page of that chapter. Then if I scroll forward to chapter 9, once the swipe is complete it then jumps to the last page of chapter 9.

Anyone else coming across this issue?

I'm having this exact same issue when using scrolled flow instead of paginated. And it seems to only happen on the first page of each chapter. Did you ever figure it out?

bguiang avatar Nov 19 '20 20:11 bguiang

So I was talking to another dev about this as well, he pointed me to this change and it seemed to help. I had to fork the repo though.

Definitely not ideal, I've fought with this package for a while..it's very buggy.

https://github.com/frasermince/epub.js/commit/1db7813ee3ac59bb3ab0c576b3bf3d50bdf407b2#diff-48d2e3d1d47f05ce8f3da98f05d11e67eb857ca7f43e9ea3cfa5fbf209aeff15R407

ErnestGrey avatar Nov 19 '20 21:11 ErnestGrey