antd4中tree的scrollTo方法是可以在没有虚拟滚动的情况下实现元素定位的,但是antd5必须设置了虚拟滚动后,scrollTo才会定位到指定key的位置上。但是虚拟滚动会导致一些额外的问题,例如没有横向滚动条、需要动态处理树的height等,比较麻烦,所以scrollTo这个api目前感觉不是很实用。
沿用scrollTo({ key: string | number; align?: 'top' | 'bottom' | 'auto'; offset?: number }) 即可,只需要支持非虚拟滚动的场景~
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too