We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Turbo appears to leave template tags in place on navigation breaking components that use Declarative Shadow DOM.
Reproduction: https://github.com/KonnorRogers/turbo-dsd-reproduction
The text was updated successfully, but these errors were encountered:
This seems to work as a sort of "polyfill"
function fixDSD (e) { const newElement = e.detail.newBody || e.detail.newFrame || e.detail.newStream if (!newElement) { return } // https://developer.chrome.com/docs/css-ui/declarative-shadow-dom#polyfill ;(function attachShadowRoots(root) { root.querySelectorAll("template[shadowrootmode]").forEach(template => { const mode = template.getAttribute("shadowrootmode"); const shadowRoot = template.parentNode.attachShadow({ mode }); shadowRoot.appendChild(template.content); template.remove(); attachShadowRoots(shadowRoot); }); })(newElement); } ;["turbo:before-render", "turbo:before-stream-render", "turbo:before-frame-render"].forEach((eventName) => { document.addEventListener(eventName, fixDSD) })
Sorry, something went wrong.
No branches or pull requests
Turbo appears to leave template tags in place on navigation breaking components that use Declarative Shadow DOM.
2024-07-29.12-35-13.mp4
Reproduction: https://github.com/KonnorRogers/turbo-dsd-reproduction
The text was updated successfully, but these errors were encountered: