Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event handlers are not re-attached to data-cc elements after changing language #193

Closed
alex-ketch opened this issue Jan 14, 2022 · 1 comment · Fixed by #196
Closed

Event handlers are not re-attached to data-cc elements after changing language #193

alex-ketch opened this issue Jan 14, 2022 · 1 comment · Fixed by #196
Labels
bug Something isn't working

Comments

@alex-ketch
Copy link

Hi, and thanks for this library 💖

In testing the new updateLanguage methods added in v2.8.0 I noticed that strings using custom data-cc attributes don't have their click handlers attached.

The specific use case I had was for the consent_modal.description text where I have a button with data-cc="c-settings" (same as the demo app).
This button stops functioning and does not open the settings modal after calling the updateLanguage method.

Is it safe to call _addDataButtonListeners after the language change, or do we need to keep track of already hydrated elements to prevent duplicate event listeners?

I can provide a PR, but will probably not be in time for the v2.8 release tag.

Thanks again!

@orestbida
Copy link
Owner

Hi @alex-ketch,

thanks for letting me know! Will fix this asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants