kiwix-js icon indicating copy to clipboard operation
kiwix-js copied to clipboard

Regression: Animate transition between app pages breaks links that jump or scroll to elements on another page

Open Jaifroid opened this issue 3 years ago • 4 comments

As per title. One workaround is to wait for the transition to complete (around 500 - 600ms), but this introduces a race and might not work on slow browsers or slow environments. The best solution would be to prevent the transition from interfering, or to make its methods aware of local anchors.

Jaifroid avatar Feb 06 '21 16:02 Jaifroid

To be clear, this issue refers to links from one of the app's pages to another inside the app. It does not refer to jumping to sections within an article.

Jaifroid avatar Jan 23 '22 16:01 Jaifroid

I am back after a small break and start working on this again. Here is what I think could work

PROPOSAL:

  • Add a global variable to manage if the animation is active or not (let animationActive = true/false)
  • We can disable the animations by default
  • cleanup the current animation code or maybe just replace it with something easy (optional if i find something easy to implement)

Rishabhg71 avatar Sep 09 '23 16:09 Rishabhg71

Global variables are attached to the params object and are set in init.js (now). There should already be one relating to this setting.

Jaifroid avatar Sep 09 '23 18:09 Jaifroid

Changing params['showUIAnimations'] = getSetting('showUIAnimations') !== false; to === true; should change the default: it will always be false unless explicitly set to true in localStorage.

Jaifroid avatar Sep 10 '23 06:09 Jaifroid