I'm displaying a Popover in a GridCell, but the content is being queried as the Popover renders.
Because of this, the initial height of the Popover is much less than it will be once the data is available. The problem I'm seeing is that when the data becomes available, the Popover increases in height but any new collision is not detected, which sometimes results in the Popover going offscreen.
Here's a demo where the Popover position is bottom, but should flip on collision. When mousing over the Popover cell in the bottommost (visible) row, initially there is enough space to display below the cell. After the setTimeout runs, the content grows off the page.
https://stackblitz.com/edit/react-tudni8?file=app/main.jsx