Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

横向滚动条状态变更时,固定列阴影显示异常 #646

Closed
lanten opened this issue Jul 9, 2021 · 1 comment
Closed

横向滚动条状态变更时,固定列阴影显示异常 #646

lanten opened this issue Jul 9, 2021 · 1 comment

Comments

@lanten
Copy link
Contributor

lanten commented Jul 9, 2021

示例代码

由 antd 定位到这里。
相关issuse:ant-design/ant-design#31319

分析代码后发现,主要是由于数据变更时未刷新横向滚动条状态导致的。

table/src/Table.tsx

Lines 497 to 501 in e26c552

React.useEffect(() => {
if (horizonScroll) {
triggerOnScroll();
}
}, [horizonScroll]);

将上面引用的代码作以下调整(在 useEffect 中添加 data订阅 ),似乎可以解决这个问题。

  React.useEffect(() => {
    if (horizonScroll) {
      triggerOnScroll();
    }
  }, [horizonScroll, data]);

请评估影响,没有问题的话,稍后我将发起PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants