petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.13k stars 299 forks source link

[BUG] Inability to use a flex container as a parent or to customize viewport #1108

Closed ohnoah closed 1 month ago

ohnoah commented 1 month ago

Describe the bug There is no way to customize the position attribute on the viewport div.

To Reproduce Steps to reproduce the behavior:

  1. Place VirtuosoTable in a flex parent. I'm using MUI. You have to set an explicit height for it to show, since the table container uses position:relative.
  2. Now, if you want to place an item that is the same height as the table, you can't, because position: relative takes it out of the document flow.

Expected behavior I can set position: static on the table container, and if I would be able to set position: static instead of position: absolute on the viewport (which I tried in devtools), I can fix the issue. However, there is no way customize the CSS on the viewport div.

Desktop (please complete the following information):

Additional context I am trying to add a "Add column" div which is the same height as my table and is right-aligned and sticky to the right. This seems impossible with the library as it is.