temp fix for page demo not showing when rendered with turbo

This commit is contained in:
Cory LaViska
2024-12-10 15:21:01 -05:00
parent 32df4598fc
commit bae9b57c2a
2 changed files with 9 additions and 1 deletions

View File

@@ -16,7 +16,7 @@
</div>
</fieldset>
<wa-viewport-demo viewport="1000">
<iframe srcdoc="" id="page_slots_iframe"></iframe>
<iframe srcdoc="" id="page_slots_iframe" data-turbo="false" data-turbo-temporary></iframe>
</wa-viewport-demo>
</div>
<script type=module src="/assets/examples/page-demo/demo.js"></script>

View File

@@ -40,3 +40,11 @@ function render() {
}
fieldset?.addEventListener('input', render);
render();
//
// TODO - fix Turbo caching. When this is removed, visiting the <wa-page> docs via Turbo will cause the <iframe srcdoc>
// to not render. Even with this, there are console errors when leaving the page.
//
// NOTE - the iframe already has `data-turbo="false"` and `data-turbo-temporary` on it.
//
document.body.setAttribute('data-turbo', 'false');