-
Hi all, I'm coding up a system to expand/collapse long event descriptions in a calendar. Without my system, the popover renders correctly and takes up the full available height. I then constrain the height using the However, with my collapse/expand button, the height of the popover is not recalculated, so it's not using the full available height. Screen.Recording.2023-04-27.at.13.14.18.movIs this expected, or is it something to do with the way I'm using a scroll area inside the popover? How can I force the popover to recompute its position and height? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Maybe using |
Beta Was this translation helpful? Give feedback.
Ok, I think I know what's going on. The
--radix-popper-content-available-height
takes into account the alignment and it seems that in the version wherefloating-ui
is used in Radix the available height is not calculated as expected if the alignment is centered and placement is left/right.You can play around with the
align
prop to see this happening. https://codesandbox.io/p/sandbox/loving-platform-6kyzbe?file=%2FApp.jsxLooks like this has been fixed at floating-ui/floating-ui#2163. And it seems to work as expected https://codesandbox.io/s/great-microservice-onol1m?file=/src/App.tsx
Therefore, in your case I think you will have to use
max-height: 100vh