You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The language change causes a full page re-render, and the markup generated by the plugin is being destroyed.
Since this is a vanilla js plugin (and not a react component) you need to be extra careful on how you initialize the plugin.
You need to initialize the plugin on a higher level, so that it does not get re-rendered. Here is a demo. Try navigating between pages, and you'll see that the markup is not destroyed.
Expected Behavior
The modal window showPreferences should open correctly after switching the language, both via the data attribute and onClick event.
Current Behavior
After switching the language, the modal window showPreferences does not open, neither via the data attribute nor the onClick event.
Steps to reproduce
Reproducing the error:
https://stackblitz.com/~/github.com/spalz/CookieConsent
Steps to reproduce:
Proposed fix or additional info.
Stack:
nextjs: "14.x.x"
translate package intl or i18n
Screen.Recording.2024-11-11.at.13.24.36.mov
Version
3.0.1
On which browser do you see the issue?
No response
The text was updated successfully, but these errors were encountered: