Lurker News

Comments (242) 68 threads

Show all comments

Showing thread 9 of 68

spankalee2 replies#
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.

Kalabasa1 reply#
Thanks for the suggestion, I'll update the examples.

Edit: that is, after I wake up...

KatrinaKitten#
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.