-
Couldn't load subscription status.
- Fork 6
Improve reliability of grid selection mode #2813
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 231fa45 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 |
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 improves the reliability of selection mode in the grid component by introducing a selects property on the grid itself. Previously, when an <sl-grid-selection-column> was added to a grid, it would set the selection mode on the data source, but this configuration would be lost when the items property was updated (triggering a new data source creation).
Key changes:
- Added a
selectsproperty to the grid that accepts 'single' or 'multiple' values - Grid now passes the
selectsvalue to newly created data sources - Selection column sets the grid's
selectsproperty in addition to the data source
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/components/grid/src/grid.ts | Added selects property and passes it when creating ArrayListDataSource from items |
| packages/components/grid/src/selection-column.ts | Sets grid's selects property to 'multiple' when attached |
| packages/components/grid/src/grid.spec.ts | Added comprehensive tests for single and multiple selection modes |
| .changeset/gentle-peaches-battle.md | Documents the improvement to selection mode reliability |
🕸 Website previewYou can view a preview here (commit |
🕸 Storybook previewYou can view a preview here (commit |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Fixes #2804