react-component / react-component/table

VirtualTable 虚拟列表如何处理 load more?

Open
#1,123 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

正常列表通过监听 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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.