react-component / react-component/table
VirtualTable 虚拟列表如何处理 load more?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 618
- Avg merge
- 10h 19m
- Merged PRs (30d)
- 2
Description
正常列表通过监听 scroll 可以实现 onLoadMore,但换成虚拟列表就不行了
...
const tableBody = document.querySelector(".g-table-body");
console.log("tableBody: ", tableBody);
if (tableBody) {
const scrollListener = (e: any) => {
if (tableBody.scrollTop === 0) {
onTop?.(e);
}
if (tableBody.scrollTop + tableBody.clientHeight === tableBody.scrollHeight) {
onLoadMore?.(e);
}
};
const listener = debounce(scrollListener, 200);
tableBody.addEventListener("scroll", listener);
return () => {
tableBody.removeEventListener("scroll", listener);
};
....
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
No source file or test is named. Start by locating the virtual-table entry point and the .g-table-body scroll container, then trace how onTop and onLoadMore are connected; done means both callbacks reliably fire at the corresponding scroll boundaries with virtualized rows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100