Virtual scrolling inside Lists and Tables
Nobody has claimed this yet.
Assessment
This issue has not been assessed yet.
Description
Feature Request Description
Virtual scrolling inside list. See the list options for grow (you'll have to scroll down to it) or
this image.
Proposed Solution
What all solutions will need:
All solutions will need an item-height property.
Solution 1: Simplest to implement
Add another ListGrowingMode: VirtualScroll, which causes the scrollbar to be reflective of the whole loadable content, and fires the load-more event with parameters startIndex: number and endIndex: number. This requires the user to handle inserting the items at the right place.
Code Example:
<ui5-list
id="infiniteScrollEx"
style="height: 300px"
growing="VirtualScroll"
item-height="28"
<!-- Show busy at first, since no item is loaded. Start by firing the load-more event -->
busy
></ui5-list>
<script>
const infiniteScrollEx = document.getElementById("infiniteScrollEx");
infiniteScrollEx.addEventListener("load-more", (e) => {
infiniteScrollEx.busy = true; // The first time, it is already true.
const startIndex = event.details.startIndex;
const endIndex = event.details.endIndex;
for(let i = startIndex; i < endIndex; i++) {
const li = document.createElement("ui5-li");
li.textContent = "Fruit name" + i;
// The following function doesn't exist.
// see https://stackoverflow.com/a/39181175/9329985
infiniteScrollEx.appendChildAtIndex(li);
}
infiniteScrollEx.busy = false;
});
</script>
Solution 2: A better solution, requiring more work
Provide a property, which is a function, that requests the right items.
Code Example:
<ui5-list
id="infiniteScrollEx"
style="height: 300px"
growing="VirtualScroll"
item-height="28"
item-count="10000"
></ui5-list>
<script>
const infiniteScrollEx = document.getElementById("infiniteScrollEx");
infiniteScrollEx.dataHandler = (startIndex, endIndex) => {
// get info from a database or any other source
const data = []
// In this case, simply generate it
for(let i = startIndex; i < endIndex; i++) {
const li = document.createElement("ui5-li");
li.textContent = "Fruit name" + i;
data.push(li);
}
return data;
}
</script>
Priority
Medium
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 285
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 59
Contributor guide
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.
More from UI5/webcomponents
-
bug Low Prio TOPIC B
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
UI5/webcomponents#14061 · 1 comment ·
-
ACC TOPIC RD
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
UI5/webcomponents#14004 · 2 comments ·
-
bug TOPIC B
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
UI5/webcomponents#13888 · 2 comments ·
-
bug High Prio TOPIC Core
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
UI5/webcomponents#13661 · 1 comment ·
-
feature request Medium Prio TOPIC RL
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
UI5/webcomponents#4619 · 3 comments ·
All issues in UI5/webcomponents
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·