Reusing the element like this is a bad idea - it has very specific behavior in browsers. In a shadow root it'll be replaced by the children of the host element, no matter what the library does.
HTML already has an inert element for things like this.
Slight correction - is not inert for users who use screen readers, though in this case it shouldn't cause issues. If you need an actual inert element, use a div.
Comments (242) 68 threads
Show all comments
Showing thread 9 of 68
HTML already has an inert element for things like this.
Edit: that is, after I wake up...
Anyway I chose div instead thanks to the other commenter https://github.com/Kalabasa/htmz/commit/153a5a448b60a0898604...