react-component / react-component/table
虚拟滚动时,固定列阴影消失
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 618
- Avg merge
- 10h 19m
- Merged PRs (30d)
- 2
Description
当开启虚拟滚动时,固定列为按照预期设置阴影效果
原因是虚拟滚动时,触发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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Table.tsx at the onInternalScroll handling around lines 441-443 and the scrollWidth/clientWidth logic around lines 457-465. Check how scrollHeaderRef.current is available during virtual scrolling and verify the fixed-column shadow behavior when virtual scrolling is enabled. Done means the shadow is retained in that mode without regressing regular 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
- Clearly specified
- Newbie friendliness
- 45/100