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

scrollDown malfunctions if it needs to scroll up instead #1048

Open
dstelzer opened this issue Mar 28, 2024 · 1 comment
Open

scrollDown malfunctions if it needs to scroll up instead #1048

dstelzer opened this issue Mar 28, 2024 · 1 comment

Comments

@dstelzer
Copy link

Describe the bug

The scrollDown method in main.js is supposed to scroll to the new text after making a choice. This normally does require, well, scrolling down. But it can sometimes require scrolling up instead, if there are enough choices that the top of the first choice is above the browser viewport. When this happens it tries to scroll upward forever, preventing the user from accessing anything lower on the page.

To Reproduce

Have a long enough list of choices and a high enough browser zoom that the top of the choice list is above the viewport. Click any choice.

Expected behavior

It should scroll up to the appropriate position, or at the very least not freeze up.

Ink files

N/A

Environment

  • OS: Linux, though my game testers have reported it on several OSes and browsers
  • Web browser version: Firefox, though see above
  • inklecate version: ??
  • inkjs version: 2.1.0

Additional context

The broken line is:

var duration = 300 + 300*dist/100;

This results in a negative duration when dist is negative, which means the animation never ends. It should instead be Math.abs(dist).

@smwhr
Copy link
Collaborator

smwhr commented Mar 29, 2024

Hi, issues about the main.js generated by inky should be reported on the inky repository

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

No branches or pull requests

2 participants