-
Notifications
You must be signed in to change notification settings - Fork 622
fix(SelectPanel): do not depend on id for selection comparison #5986
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: d9baeee 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 |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
Uh oh! @francinelucca, at least one image you shared is missing helpful alt text. Check your pull request body to fix the following violations:
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
|
size-limit report 📦
|
…ix/selectpanel-atch
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 an issue in the SelectPanel where items without an id were being incorrectly marked as selected by comparing using the id property.
- Updated comparison logic on both intermediateSelected (for single-select modal) and selected (for anchored select) items, using the entire item for comparison when id is absent.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/react/src/SelectPanel/SelectPanel.tsx | Modified item equality comparison logic to avoid reliance solely on id |
.changeset/fluffy-squids-hug.md | Added changeset for the patch release |
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
This PR fixes a bug in the SelectPanel where items without an id were being incorrectly shown as selected, by switching the comparison to use the entire item object when needed.
- The single-select modal comparison is now modified to check for an id before falling back to object equality.
- The single-select anchored comparison has a similar update to compare the full object when an id is absent.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/react/src/SelectPanel/SelectPanel.tsx | Updates selection comparison logic to fall back to object equality when id is absent. |
.changeset/fluffy-squids-hug.md | Adds a changeset entry indicating a patch release for the SelectPanel bug fix. |
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.
Pre approving, check comments!
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fixes bug where items without an id where being shown as selected when they weren't. Example: https://primer.style/product/components/select-panel/#single-select
Changelog
Changed
Rollout strategy
Testing & Reviewing
Merge checklist