kiwix-js
kiwix-js copied to clipboard
Regression: Animate transition between app pages breaks links that jump or scroll to elements on another page
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.
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.
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)
Global variables are attached to the params
object and are set in init.js
(now). There should already be one relating to this setting.
Changing params['showUIAnimations'] = getSetting('showUIAnimations') !== false;
to === true;
should change the default: it will always be false unless explicitly set to true in localStorage.