accessibility icon indicating copy to clipboard operation
accessibility copied to clipboard

Negative line height breaks page when loading from state

Open calcifer63 opened this issue 1 year ago • 1 comments

I found this bug and I think I know how to solve it aswell.

How to reproduce

I would recommend you reproduce this error on Firefox as it is easier to fix but I have also reproduced it on Chrome:

  1. Go to the demo page of this project.
  2. Reset your accessibility options and decrease the line height by 1 to make it negative.
  3. Refresh the page.

The page should now be in an infinite loading state. Using firefox you can simply wait until the browser gives you a prompt to kill the running process and delete your local storage via the dev tools. On Chrome the easiest way I think is to disable JS for the site and clear the local storage once you can actually load the page.

How to fix

I can't really test it myself and provide a pull request sadly (sorry about that) but I think the fix should be straight forward:

In this line of code I think it should be this: while (lineHeight++) { like it is for the other options (like textSpace above).

Sorry for not simply providing a pull request and I hope this issue is understandable and you can work with the information given. I you have any further questions or problems reproducing let me know.

calcifer63 avatar Oct 07 '24 15:10 calcifer63

@calcifer63 Thank you for letting me know. The bug was fixed.

ranbuch avatar Oct 13 '24 11:10 ranbuch