Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching Epub urls causes pageChanged callback to return currentPage as -1 #93

Open
abdulwahabone opened this issue Feb 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@abdulwahabone
Copy link

Background
On my Epub App, I am switching between epubs. I need to get current page and total page on load to show it on my navigation. To get the total page and current page, I am using pageChanged callback on the EpubViewer.

Issues

  1. The pageChanged callback sometime returns currentPage as -1 and total page as 0 and I cant use that on my navigation.
  2. CurrentPage is sometimes 0, not sure if this is a bug or that just how epubs are.

To Reproduce
I have created a codesandbox demo

  1. Go to the demo link on incognito, make sure cache/localstorage is clear.
  2. Change Epubs using the change epub button.
  3. Notice that current page is sometimes -1 and total page is 0.
  4. You can also check the console to see the complete object returned from pageChanged callback.
Screenshot 1 Screenshot 2
Screenshot 2023-02-23 at 12 09 45 PM Screenshot 2023-02-23 at 12 09 36 PM

Issue is happening across all devices and browsers

@abdulwahabone abdulwahabone changed the title Switching Epub urls causes pageChanged callback to return cuurentPage as -1 Switching Epub urls causes pageChanged callback to return currentPage as -1 Feb 23, 2023
@altmshfkgudtjr
Copy link
Owner

Thanks for your interest in our library.

In my environment, Total Page appears as 0, so it seems that it is not well reproduced.
I need to spend some more time checking it out.

@altmshfkgudtjr altmshfkgudtjr added the bug Something isn't working label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants