Thanks for submitting an issue to RGL!
Please mark the type of this issue:
There is autoSize for Grid Layout.
// If true, the container height swells and contracts to fit contents
autoSize: ?boolean = true,
Is there the same for Grid Item? I don't want to set height manually. I want Grid Item to adjust automatically to its content height. How to enable it?
No, it doesn't do that.
Is there no way to get it to do this? I'm thinking about a Grid Item containing a <textarea /> that can grow vertically as you're typing.
Is there no way to get it to do this? I'm thinking about a Grid Item containing a
<textarea />that can grow vertically as you're typing.
I've written my own height layer hoc for the components inside of the GridItem that adjusts the height after the initial render.
I cannot open source it currently, as it's internal and still a bit wonky under a few conditions. However, the gist of it is that you set a ref on the component, calculate the child element heights including padding, margins via *.offsetHeight and window.getComputedStyle(<your node here>) and just send it back to wherever you keep the layout state and adjust it there.
Hope this helps. I'll open source the component once I'm done with it completely.
@TheImpressionist Any news on this ?
When I put a TextArea in the grid it doesn't resize the grid when it (the textarea) grows, it just slides under any components that are beneath it.
I'll try to work with your 'gist' but It might just a bit out of my league
Thanks
Most helpful comment
Is there no way to get it to do this? I'm thinking about a Grid Item containing a
<textarea />that can grow vertically as you're typing.