diff --git a/lib/clapton/javascripts/dist/client.js b/lib/clapton/javascripts/dist/client.js index 90045ac..c0e4d4f 100644 --- a/lib/clapton/javascripts/dist/client.js +++ b/lib/clapton/javascripts/dist/client.js @@ -1448,6 +1448,13 @@ document.addEventListener("DOMContentLoaded", async () => { const event = new Event('clapton:render'); document.dispatchEvent(event); }); +document.addEventListener("turbo:render", async () => { + await initializeComponents(); + initializeActions(); + initializeInputs(); + const event = new Event('clapton:render'); + document.dispatchEvent(event); +}); window.addEventListener('beforeunload', () => { sessionStorage.setItem('scrollPosition', window.scrollY.toString()); }); diff --git a/lib/clapton/javascripts/src/client.ts b/lib/clapton/javascripts/src/client.ts index 7e93890..9828673 100644 --- a/lib/clapton/javascripts/src/client.ts +++ b/lib/clapton/javascripts/src/client.ts @@ -46,6 +46,14 @@ document.addEventListener("DOMContentLoaded", async () => { document.dispatchEvent(event); }); +document.addEventListener("turbo:render", async () => { + await initializeComponents(); + initializeActions(); + initializeInputs(); + const event = new Event('clapton:render'); + document.dispatchEvent(event); +}); + window.addEventListener('beforeunload', () => { sessionStorage.setItem('scrollPosition', window.scrollY.toString()); });