Unmeasured height in scrollable parent
Hi, dear. First of anything, thank you for publishing this usefull library.
I was using the json tree in a scrollable parent, but it seems you are using fillMaxHeight in a part of your code which causes unmeasured height crash (infinity height), becuase of that, i should set height for the json tree or max height. The suggestion is if you can, depend the json tree height on content.
Hi, thank you for using JsonTree!
JsonTree adapts to the height of its content, but it uses a LazyColumn internally to render the tree, which can cause a crash when the parent is also scrollable. You can prevent that by applying a fixed height or weight to JsonTrees Modifier, depending on your layout. Something like this could work:
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
) {
// some content
JsonTree(
modifier = Modifier
.height(500.dp) // or weight(1F)
.fillMaxWidth()
)
// some content
}
Right, using weight not working, i should give fixed height or heightIn(2000.dp) to make it height depend on it content.
You can give JsonTree any fixed height that you want, since JsonTree itself is scrollable. So you can choose how much space it should take in your scrollable parent.
I think heightIn() will still crash for the same reason.