react-component / react-component/table

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

Open
#1,010 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.4k
Forks
618
Avg merge
10h 19m
Merged PRs (30d)
2

Description

在使用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])

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in rc-table/es/stickyScrollBar.js, focusing on onContainerScroll and how the table body height is read. Reproduce a sticky table whose data changes rapidly, then verify that the bottom scrollbar visibility follows the rendered body height after the update. Done means the scrollbar is correct in the reported scenario without regressing normal sticky scrolling.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.