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

Unexpected scroll behaviour using keys in epub reader #321

Open
zeoint opened this issue Jan 1, 2024 · 12 comments
Open

Unexpected scroll behaviour using keys in epub reader #321

zeoint opened this issue Jan 1, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@zeoint
Copy link

zeoint commented Jan 1, 2024

Type of installation

Portable (.zip)

Type of reader (if reader related)

epub

Steps to reproduce

When two opposite direction keys are pressed and held down the epub reader keeps scrolling in the upward direction.

  1. Open any epub, txt or xhtml file.
  2. Go to 50% (Not a bug, but for convenience when using keys).
  3. Press and Hold the "DOWN DIRECTION KEY".
  4. Without releasing the "DOWN DIRECTION KEY", press and hold the "UP DIRECTION KEY".
  5. The reader keeps scrolling upward.
  6. This also applies when you do the same procedure first using the "UP DIRECTION KEY" and then "DOWN DIRECTION KEY".
  7. The reader keeps scrolling upward in this case too.

✔️ Expected Behavior

  • For the Epub reader to not keep scrolling upward in both cases and to stop scrolling when two opposite direction keys are held down.
  • Example - In the Image reader, doing the same will stop the scrolling and does not go in any direction.

Image.Reader.mp4

❌ Actual Behavior

  • The Epub reader keeps scrolling upward in both cases.

EPUB.And.xhtml.Reader.mp4
@zeoint zeoint added the bug Something isn't working label Jan 1, 2024
@zeoint zeoint changed the title Unexpected scroll behaviour using keys Unexpected scroll behaviour using keys in epub reader Jan 1, 2024
Copy link

github-actions bot commented Jan 1, 2024

Thank you for your feedback and suggestions. Please note that the author might only respond on weekends, so we kindly ask for your patience and understanding.

@zeoint
Copy link
Author

zeoint commented Jan 1, 2024

❌ Actual Behavior

The Epub reader keeps scrolling upward in both cases.

The direction being scrolled can be seen on the top right progress indicator.

@zeoint
Copy link
Author

zeoint commented Jan 1, 2024

This unexpected scroll behavior bug might be linked to another bug that is hard to reproduce. That bug occurs randomly.

When I am reading epub or xhtml files, suppose I am at 10% or at any random%, the reader goes to the top (0%) automatically when I increase or decrease the font size or increase or decrease the page width (zoom).

@mienaiyami
Copy link
Owner

When I am reading epub or xhtml files, suppose I am at 10% or at any random%, the reader goes to the top (0%) automatically when I increase or decrease the font size or increase or decrease the page width (zoom).

Its not related, in recent updates I have tried 2 methods to fix this.

  1. Scroll back to element that was on top before size changes. But it doesnt really work great because, let if you are reading some line on bottom side of screen, it will scroll to the topmost line that was on screen at that time.
  2. And current version of app just rely on default behavior of electron window. Most of the time even if you change font, size, padding, etc, it will keep right thing in focus. But it doesnt work sometimes, and I dont know why yet.

As you can see, text is not similar to image. On changing width of image, its height scales proportionally to width. But that is not the case with text, on changing properties, text will wrap so it doesnt go out of bounds, resulting in unknown height.

@mienaiyami
Copy link
Owner

My bad, 2. is actually what I was using before, and Im using modified 1. now.
It gets the element on top of screen and scroll to it after changes.

on changing properties here it will scroll to top of the paragraph
image
image

Total length of this chapter is big so you wouldn't see change in progress.

@zeoint
Copy link
Author

zeoint commented Jan 1, 2024

Please check this out. And as you said I could not reproduce this for a large chapter. The below video is from a small chapter.

CTO.mp4

And I opened the dev tools to see if any error has been recorded there and I found that every time I open an epub, txt or xhtml file, there seems to be some error.

Log File

@mienaiyami
Copy link
Owner

Its because of gaps between elements. Instead of that certain element, its parent element was selected because of the gap.

I have made many guards against it but at the end of day it still depends on the epub file.
I made sure that it continues to next pixel line if it detects certain elements (that are generally not used for text/images) but it totally depends on the structure in epub file.

In your case, I think they are using "gap" instead of "padding on paragraphs", which might be the reason for this behavior.

@zeoint
Copy link
Author

zeoint commented Jan 2, 2024

In your case, I think they are using "gap" instead of "padding on paragraphs", which might be the reason for this behavior.

If you need to check the structure, here is the EPUB file - Devil Slave (Satan System).zip.

@mienaiyami
Copy link
Owner

Cant reproduce. Please check if it is still present.

@zeoint
Copy link
Author

zeoint commented Jan 21, 2024

It's still present.
Upto 9 seconds of video I did not press two keys at a time, its to show you speed of each key.
After that I pressed the opposite key.


keys.test.mp4

@mienaiyami
Copy link
Owner

I still cant reproduce it. It could be a keyboard issue, where other key is leaking for few milliseconds.
Try binding it to other keys and check.

@zeoint
Copy link
Author

zeoint commented Jan 21, 2024

Nope checked with different keys and another keyboard, but its still present.

W = Scroll up
S = Scroll down

  1. Go to 50% (for ease) hold 'w' (scroll up).
  2. Without releasing the scroll up key, hold the 's' (scroll down) key and true for vice versa.
key.test.mp4

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
Status: For Review
Development

No branches or pull requests

2 participants