4 ms·
Reusing the <slot> 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 e
by spankalee 3y ago
Reusing the <slot> 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 <output> element for things like this.
- KatrinaKitten 3y agoSlight correction - <output> 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.
- Kalabasa 3y agoThanks for the suggestion, I'll update the examples. Edit: that is, after I wake up...
- Kalabasa 3y agoWoke up... It's at the top of HN... Anyway I chose div instead thanks to the other commenter https://github.com/Kalabasa/htmz/commit/153a5a448b60a0898604380f23e5781b5736e798 https://github.com/Kalabasa/htmz/commit/153a5a448b60a0898604...