Hi,
I want to make SortableTree height fit its content, without the need to explicity set the height and without the scroll, making it auto. The problem is, the only way according to the documentation to accomplish this is by setting the isVirtualized prop, but by doing so I lost all the nice styling that happens when dragging a node. So, how can i make it full height without losing the styling?
I've used generateNodeProps to dynamically set styles. It may be worth exploring. You could potentially use code to determine the amount of content you have and extrapolate the height size accordingly. Example:
generateNodeProps={({ node, path, treeIndex }) => ({
title: node.title != 'someValue' ? (
<div
style={{ fontSize: '.6rem' }}
...
) : (
<div
style={{ fontSize: '.9rem' }}
...
import SortableTree, { getVisibleNodeCount } from "react-sortable-tree"
...
const count = getVisibleNodeCount({treeData:this.props.treeData})
style={{height: count * 62}} // height of each node
@Imagine-F yeah that :)
Most helpful comment
import SortableTree, { getVisibleNodeCount } from "react-sortable-tree"
...
const count = getVisibleNodeCount({treeData:this.props.treeData})
style={{height: count * 62}} // height of each node