Open 2Pacalypse- opened 2 years ago
I'm still unsure why you do tables with divs, but to each their own. Feel free to submit a PR over the matter.
Hi @petyosi, browser's native behavior for tables can sometimes get in the way when it comes to making native-like data tables: sometimes entire rows can have context menus, or be link/other clickable context for sighted users, while maintaining table semantics for screen readers. There's also random quirks (as it's always the case with the web) like sticky headers behaving weirdly in Chrome when borders are collapsed, etc.
I think this is a valid issue, the TypeScript bits can be technically silenced by assertion in the userland, but the library also injects a tr -> td
filler that triggers validateDomNesting
errors from react-dom
. I'll look into sending a PR once I figure out how the latter works.
@tigranpetrossian the filler is also exposed as a custom component. https://virtuoso.dev/api/interfaces/_interfaces_.tablecomponents#fillerrow
Thanks @petyosi ❤️ Found that out after digging deeper.
any updates?
Describe the bug When using a custom TableBody component, we need to forward a
ref
to it. However, react-virtuoso types expect thisref
to point to atbody
element, so when I try to use adiv
element instead, I get a TypeScript error.Reproduction
Expected behavior It would be nice if we could use the non-
tbody
elements forTableBody
component without resorting to usingas any
.