Skip to content
New issue

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

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

Already on GitHub? # to your account

Bug with continuous scroll on Android devices #1408

Open
Cherevatin opened this issue Feb 28, 2025 · 1 comment
Open

Bug with continuous scroll on Android devices #1408

Cherevatin opened this issue Feb 28, 2025 · 1 comment

Comments

@Cherevatin
Copy link

Hi there!

I'm trying to epub book reader using epub-js and React Native. I found epubjs-react-native which is a wrapper over this library for convenient using in RN.

I want to make a continuous scroll throughout the whole book. To do this, I changed the corresponding parameters (see screenshot, manager is method in epub-js). So, after I set method=continuous and flow=scrolled the problem shown in the video appears on Android: when navigating to any chapter, the movement is incorrect. At the same time, everything works correctly on the iPhone.

I investigated epubjs-react-native source code and found that it only calls rendition.display() method to change the location, so I decided to dive into epub-js code because epubjs-react-native doesn't have any side effects on it.
In epub-js code, I was focused on the continuous manager's index.js file. There is update() and check() functions. During debugging, I found that after rendition.display() call the first navigation happens correctly (the exact location that is needed opens) but then update() or check() (I can't say exactly) methods are called again and moves book content to the wrong location. I tried to modify the code for a couple of days but there are a lot of variables and it's hard to understand their purpose without deep knowledge of this library's logic.

I would be very grateful if someone could tell me what the problem is.

417603789-1e0eb58a-d344-45e2-94bf-a472fd5ee9ae.mov
Image

cc @fchasen @JakeHartnell

@Cherevatin
Copy link
Author

Cherevatin commented Mar 5, 2025

I found a solution
Fixed here

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant