I realized there was actually this trivial fix. Initially rendering tree's position: 'static' places the tree following the flow of the flexbox, which is fine initially when the tree does not overflow. Subsequent interaction causes the ref.current to become defined, so positioning will switch to absolute, as is needed for scrolling to work correctly
I realized there was actually this trivial fix. Initially rendering tree's position: 'static' places the tree following the flow of the flexbox, which is fine initially when the tree does not overflow. Subsequent interaction causes the ref.current to become defined, so positioning will switch to absolute, as is needed for scrolling to work correctly