StreamlitAntdComponents icon indicating copy to clipboard operation
StreamlitAntdComponents copied to clipboard

Treeview Sizing Issues

Open MonkeyChap opened this issue 5 months ago • 1 comments

This manifests as two problems, but I suspect the cause could be the same.

  1. When you open a node using the down-arrow icon, the node opens, but the tree component does not resize. If you click on the node itself, after opening in the node, the tree will then resize. Interestingly, this doesn't happen on the demo site. I've tried it in a blank streamlit app (where it is the only component) and the problem is repeatable.

  2. There doesn't seem to be any way to size the tree to fit in a streamlit container or column. The component ends up sitting at its starting size until it is opened up, and a node clicked (see above issue). The result is pretty ugly, with scroll-bars showing up in the middle of the app:

Image

If this is just a config thing, then it would great to see some documentation on how to do it.

MonkeyChap avatar Aug 12 '25 11:08 MonkeyChap

This occurs when a key is set. Try remove the key and instead maintain the tree state yourself using the session_state.

melsabagh avatar Oct 09 '25 01:10 melsabagh