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
This is inconvenient since it prevents from using what HTML already has to offer in terms of accessibility and standard tags.
The use case for this would be applying additional styling to each row, as well as nested elements and adding some enhancement with JavaScript.
Not being able to use <slot> in a table forces users to create abominations from <div>'s with a lot of aria-* attributes which, IMO, is unnecessary.
Since slot projects content, the projected content can be evaluated whether or not it should be rendered, for example:
User defines <tr slot="row"> as a child of <tbody> - it renders;
User defines <option value="invalid">1</option> as a child of <tbody> - it does not render.
The text was updated successfully, but these errors were encountered:
GeorgeTailor
changed the title
Allow <slot> as a child of table or any of it descendants
Allow <slot> as a child of <table> or any of it descendants
Dec 14, 2020
This is being discussed in WICG/webcomponents#630 but it's largely a dead end as it requires changes to the HTML parser. I think we best keep the discussion there so I'll close this.
Currently HTML
<table>
supports only basic elements like<thead>
,<tbody>
and so on along with https://www.w3.org/TR/html52/dom.html#script-supporting-elements-2, which include<script>
and<template>
.This is inconvenient since it prevents from using what HTML already has to offer in terms of accessibility and standard tags.
The use case for this would be applying additional styling to each row, as well as nested elements and adding some enhancement with JavaScript.
Not being able to use
<slot>
in a table forces users to create abominations from<div>
's with a lot ofaria-*
attributes which, IMO, is unnecessary.Since
slot
projects content, the projected content can be evaluated whether or not it should be rendered, for example:<tr slot="row">
as a child of<tbody>
- it renders;<option value="invalid">1</option>
as a child of<tbody>
- it does not render.Full example:
The text was updated successfully, but these errors were encountered: