Skip to content

(ExpandableTile): maxHeight calculation is wrong when component is mounted off viewport #8214

Answered by jaknas
jaknas asked this question in Help
Discussion options

You must be logged in to vote

yeah it looks like because these tiles are placed within tabs, they are mounted to the DOM and never rerendered since the visibility is toggled by the hidden attribute on the tab. I don't think we would add a one-off prop to specify the height of a tile, but a possible solution may be to create a higher order component that renders the tile when its parent is visible, using the Intersection Observer API (something like this https://github.com/AvraamMavridis/react-intersection-visible maybe). I don't think there's a reasonable way for us to support this use case out of the box though

Thank you for checking this out! Indeed, this can be done in user-land. I opened a new code-sandbox with r…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by joshblack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #7217 on March 29, 2021 16:39.