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

Sticky时,底部scroll-bar显示异常 #1010

Open
congxiaobai opened this issue Aug 16, 2023 · 0 comments
Open

Sticky时,底部scroll-bar显示异常 #1010

congxiaobai opened this issue Aug 16, 2023 · 0 comments

Comments

@congxiaobai
Copy link

congxiaobai commented Aug 16, 2023

在使用table sticky时,部分场景下发现
image

经排查,发现在计算scrollbar是否需要显示时,table的高度与实际渲染的高度不一致导致的。
文件位置rc-table/es/stickyScrollBar.js :
onContainerScroll
推测是由于table数据再短时间内发生了变化,计算时只用了第一次传入的table数据。
经修改,加入以下代码可以解决问题


  const bodyHeight = scrollBodyRef.current?.offsetHeight ||0
  React.useEffect(()=>{

    if(bodyHeight){

      onContainerScroll();

    }
  },[bodyHeight])

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

1 participant