-
Notifications
You must be signed in to change notification settings - Fork 6
Lazy loaded tree children should inherit selected parent state #2811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 6d3e69f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🕸 Website previewYou can view a preview here (commit |
🕸 Storybook previewYou can view a preview here (commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where lazy-loaded child nodes in a tree with multiple selection enabled were not inheriting the selected state from their parent node. When a selected parent node is expanded and its children are lazy-loaded, all children should automatically be selected to maintain consistent selection state.
Key Changes
- Added logic to automatically select lazy-loaded children when their parent is already selected (in both
NestedTreeDataSourceandFlatTreeDataSource) - Added comprehensive test coverage for lazy loading scenarios in both data source implementations
- Updated the
LazyLoadstory to enable multiple selection for better demonstration
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/components/tree/src/nested-tree-data-source.ts | Added selection inheritance logic for lazy-loaded children |
| packages/components/tree/src/flat-tree-data-source.ts | Added selection inheritance logic for lazy-loaded children |
| packages/components/tree/src/nested-tree-data-source.spec.ts | Added comprehensive test suite for lazy loading with selection state |
| packages/components/tree/src/flat-tree-data-source.spec.ts | Added comprehensive test suite for lazy loading with selection state |
| packages/components/tree/src/tree.stories.ts | Enabled multiple selection in LazyLoad story |
| .changeset/legal-symbols-build.md | Added changeset describing the fix |
Fixes #2806