Skip to content

fix: prevent items from getting continually loaded in S2 async TreeView#9921

Merged
LFDanLu merged 1 commit intomainfrom
async-tree
Apr 14, 2026
Merged

fix: prevent items from getting continually loaded in S2 async TreeView#9921
LFDanLu merged 1 commit intomainfrom
async-tree

Conversation

@yihuiliao
Copy link
Copy Markdown
Member

found during testing where the S2 async loading tree story continually loads new items even if you aren't scrolling to the bottom anymore which was caused by #9747

the root cause is because we now always render TreeView in a wrapper. in this particular story, the wrapper has no constrained height, so it expands to fit all its content and so we continually load more items.

the other alternative solution is to just fix the story and pass a height directly onto TreeView but it feels like there might be other people relying on the parent container to constrain the TreeView height

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Go to the S2 async loading TreeView example and make sure it doesn't continuously load new items even when you aren't scrolled to the bottom

🧢 Your Project:

@github-actions github-actions bot added the S2 label Apr 13, 2026
@yihuiliao yihuiliao changed the title fix: prevent items from getting continually loaded in S2 TreeView fix: prevent items from getting continually loaded in S2 async TreeView Apr 13, 2026
@rspbot
Copy link
Copy Markdown

rspbot commented Apr 13, 2026

Copy link
Copy Markdown
Member

@devongovett devongovett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is an ok default. We don't have it on any of our other collections though... Is the issue treeview specific?

@snowystinger
Copy link
Copy Markdown
Member

I checked the equivalent TableView and ListView stories, they would have the same problem, but we pass a height to each of them at the root of the stories configuration.


Remove that and add the resizing container, the ListView will also infinitely load.

@LFDanLu LFDanLu added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main with commit 2d2cc15 Apr 14, 2026
30 checks passed
@LFDanLu LFDanLu deleted the async-tree branch April 14, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants