You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only the second button works. Is it possible to make the first one work too?
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8" /><metaname="viewport" content="width=device-width, initial-scale=1" /><title>test htmx with shadowdom</title><scriptsrc="https://unpkg.com/htmx.org@2.0.0"></script></head><body><div><templateshadowrootmode="open"><header>Header</header><main><buttonhx-post="/clicked" hx-swap="outerHTML">
doesn't work
</button><slotname="content1">
Loading...
</slot></main><footer>Footer</footer></template><divslot="content1"><buttonhx-post="/clicked" hx-swap="outerHTML">
works
</button></div></div></body></html>
My goal is to do something like Streaming HTML out of order without JavaScript.
I would like to avoid sse since I would prefer that the server start processing the data needed for "content1" right away and stream it when ready.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Only the second button works. Is it possible to make the first one work too?
My goal is to do something like Streaming HTML out of order without JavaScript.
I would like to avoid sse since I would prefer that the server start processing the data needed for "content1" right away and stream it when ready.
EDIT: I asked the same question on https://stackoverflow.com/questions/78644957/is-htmx-2-0-usable-within-a-shadowrootmode
Beta Was this translation helpful? Give feedback.
All reactions