Replies: 2 comments 4 replies
-
Hi, I can provide getBoundingClientRect({ element: Element, index: number }) prop with getClientWidth/ClientHeight props. Then you can return computed item rect and size by children. Is this something you need? I think that using a first child is not a good solution since I need to top and bottom rect props (it can be first child top and last child bottom for example) Also, could you provide minimal reproduction with display:contents? I want to understand you case correctly. |
Beta Was this translation helpful? Give feedback.
-
I have created a codesandbox with an example. It sort of works with itemMinSize but the items are not removed from the DOM when scrolling back up so not virtual anymore. https://codesandbox.io/s/upbeat-ardinghelli-0oi84g?file=/src/App.js I meant first child of each item in the list not of the list itself. It is currently using the elements in the list which have no top/bottom/height as they are display contents. Just need a prop to tell it where to look for the sizing/position element, currently it does nextSibling/previousSibling from the spacers I think. It could be a prop to return an element or they can be separate like you suggested. Currently I'm using the source code with a tweak I put in. But it would be great to get this feature supported so I don't have to keep the code manually up-to-date. Really I want Chrome to support subgrids but not much hope there! |
Beta Was this translation helpful? Give feedback.
-
I have a feature request. There are situations where the items in the list are set to "display:contents;", particularly as Chrome does not support Subgrids yet. This means that the item sizes/positions cannot be determined as they don't have style. We need to be able to say which element it should use for the size/position refs. Maybe have it look at the first child element of each item in the list. At least a Boolean prop to toggle this would be great.
Beta Was this translation helpful? Give feedback.
All reactions