i18n: Page transition broken with nuxt-i18n
Version
Reproduction link
Steps to reproduce
I have simple fade page transition
.page-enter-active {
backface-visibility: hidden;
will-change: opacity;
opacity: 1;
transition: opacity 450ms linear;
}
.page-leave-active {
backface-visibility: hidden;
will-change: opacity;
opacity: 1;
transition: opacity 450ms linear;
}
.page-enter {
opacity: 0;
}
.page-leave-active {
opacity: 0;
}
The problem is, when I change locale, text content changes instantly while page transition is not complete. In result I have a blink of content.
Is there’a a way to solve this?
What is expected ?
No blink, smooth transition
What is actually happening?
Transition broken, content blink
<div align="right">This bug report is available on Nuxt community (#c163)</div>About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 10
- Comments: 34
@lu40 thanks, but returning transition name should not be empty
''becouse it will be replaced to default. Should return any character, e.g:The transition is copy-pasted from the original issue description. @thariddler I guess this is the behaviour you were talking about?
For me the following workaround does the job:
However this disables page transitions when switching the language instead of replacing the translated content smoothly while fading back in.
Try key in nuxt layouts.
<NuxtPage :page-key="route.fullPath" />or either
@tiretdusix Not possible at the moment. You’ll be able to do it only once my PR fixing this issue gets merged: https://github.com/nuxt-community/i18n-module/pull/963
Actually when page component actually switches is only known at the page component level (
beforeRouteLeaveoption) and at router-view level (either through watching$routeor theleaveevent of the transition). It’s not that easy or robust to hook into those…Also looking for a solution for this!
Solution for that released in https://github.com/nuxt-community/i18n-module/releases/tag/v6.20.0. Thanks to @pmrotule .
Any update on this? I see there are some conflicts on that PR plus no more comments from the repo’s maintainers
Is there already a solution to this?
Looking 4 solution too!