Hi!
When I click on the back button of the browser, the scroll top position of the current container change (randomly?), and I can't find why.
I'm using a very simple transition to test it :
.fade-leave
.fade-once-to
.fade-enter-to
opacity 1
.fade-enter,
.fade-once,
.fade-leave-to
opacity 0
.fade-leave-active,
.fade-once-active,
.fade-enter-active
transition opacity 200ms ease
Any idea ?
Thanks!
Hi @theamnesic,
Are you talking about @barba/css plugin issue?
Thanks
Hi Xavier,
I have the same behavior without @barba/css.
This scroll top move only appear on the back button.
Here a screenshot, you can see the container
Look like barba keep the previous scrollTop position even if we set to 0 at enter.
— G
Ho ok!
I wasn't figure it out ^^
Can you check this comment and tell me if it works for you?
https://github.com/barbajs/barba/issues/537#issuecomment-658160045.
Thanks!
It works!
Just put this on enter hook :
if ('scrollRestoration' in history) {
history.scrollRestoration = 'manual';
}
Merci Xavier !
De rien @theamnesic :wink:
Happy coding with Barba!
I am closing the issue.
Duplicate of #537.