Dogstudio / highway

Highway - A Modern Javascript Transitions Manager
https://highway.js.org/
MIT License
1.43k stars 92 forks source link

back/forward buttons pressed during transition break the website #111

Closed iamlinkus closed 2 years ago

iamlinkus commented 3 years ago

Hya! I love Highway and thank you (the maintainers) for an awesome library and, especially thanks for the fact that you've open sourced it!

Anyway, I've noticed that when using back/forward browser buttons while transition (or fetch) is not finished, it breaks the website by unpredictable behavior (for example loading both the previous content and the next).

This is probably something of an edge case (I'm assuming as I haven't found such an issue here), but maybe something worth looking at?

I know back/forward are not cancelable events, but maybe there is something that can be adjusted on the highway side?

Also, another altnernative solution would be the option to disable highway routing/transitions when the user clicks the back/forward buttons (that's something that swup offers).

I've tried it on all of the websites using highway I could find. Even https://dogstudio.co/ breaks if I use back/forward while it's still fetching. Or for example if I click those buttons quickly.