react-component / table

React Table
https://table.react-component.now.sh
MIT License
1.27k stars 580 forks source link

虚拟滚动时,固定列阴影消失 #1116

Open hairgc opened 2 months ago

hairgc commented 2 months ago

当开启虚拟滚动时,固定列为按照预期设置阴影效果

原因是虚拟滚动时,触发onInternalScroll事件时传入的currentTarget为virtuallist组件的ref, https://github.com/react-component/table/blob/f968c9edd2b4bb03ed46960fa4b98f527d312f9c/src/Table.tsx#L441-L443

导致内部未正常获取到scrollWidth, clientWidth,拿到的是undefined https://github.com/react-component/table/blob/f968c9edd2b4bb03ed46960fa4b98f527d312f9c/src/Table.tsx#L457-L465

应当优化scrollWidth, clientWidth获取逻辑,虚拟滚动时可以优先从scrollHeaderRef.current获取 https://github.com/react-component/table/blob/f968c9edd2b4bb03ed46960fa4b98f527d312f9c/src/Table.tsx#L457

linxianxi commented 2 months ago

看 antd 官网没问题啊,建议 issue 提到 antd 那边去并提供复现。一般不会关注这边的 issue。

hairgc commented 2 months ago

看 antd 官网没问题啊,建议 issue 提到 antd 那边去并提供复现。一般不会关注这边的 issue。 官网就是有问题的,你进入到虚拟滚动demo,注意鼠标先不要在虚拟滚动列表滚动,直接把边框属性关掉

image