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

Need to watch for turbo:morph events #165

Open
adampal opened this issue Apr 4, 2024 · 0 comments
Open

Need to watch for turbo:morph events #165

adampal opened this issue Apr 4, 2024 · 0 comments

Comments

@adampal
Copy link

adampal commented Apr 4, 2024

I'm using the new turbo page refresh action with turbo morphing. When the page is morphed, it undoes the changes made by local_time in the DOM.

The fix was to add this:

document.addEventListener("turbo:morph", () => {
  LocalTime.run()
})

Seems like the gem should probably handle this by default? If so, I'm happy to submit a PR with the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant