-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(select): SelectItem
does not accept value props
#4653
base: canary
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request introduces changes to the Changes
Sequence DiagramsequenceDiagram
participant User
participant SelectComponent
participant SelectItem
User->>SelectComponent: Interact with Select
SelectComponent->>SelectItem: Render items
SelectItem-->>SelectComponent: Display with key-based value
User->>SelectComponent: Select an item
SelectComponent->>SelectComponent: Use key for form submission
The sequence diagram illustrates the updated flow where Assessment against linked issues
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 5
🧹 Nitpick comments (7)
apps/docs/content/components/select/virtualization.raw.jsx (1)
Line range hint
23-27
: Consider removing unused value property from dataset.The
value
property is generated in the dataset but no longer used after removing the value prop from SelectItem. If this property is not needed elsewhere, consider simplifying the dataset structure..changeset/light-hairs-draw.md (1)
6-6
: Fix typo in PR description."dose" should be "does"
-Fix SelectItem dose not accept value props (#2283) +Fix SelectItem does not accept value props (#2283)🧰 Tools
🪛 LanguageTool
[misspelling] ~6-~6: Did you mean the auxiliary verb “does”?
Context: ...roui/select": minor --- Fix SelectItem dose not accept value props (#2283)(DOSE_DOES)
packages/components/select/__tests__/select.test.tsx (4)
485-487
: Add test cases for form submission with key propSince the
value
prop has been removed in favor of usingkey
for form submissions, consider adding test cases that explicitly verify form submission behavior with thekey
prop.Also applies to: 490-492
622-624
: Add test case for key-based selectionConsider adding a test case that verifies the correct handling of the
key
prop in form submissions after removing thevalue
prop.
663-663
: Add virtualization tests for key-based selectionThe virtualization tests should include verification of key-based selection and form submission behavior.
Also applies to: 699-699
729-731
: Add accessibility tests for form labelsConsider adding tests to verify that form labels are correctly associated with the select component when using key-based selection.
Also applies to: 752-754
apps/docs/content/docs/components/select.mdx (1)
297-303
: Enhance documentation with migration examplesWhile the explanation about using
key
instead ofvalue
is clear, consider adding:
- Code examples showing before/after migration
- Example of implementing a lookup map for custom form values
- Best practices for key selection in forms
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.changeset/light-hairs-draw.md
(1 hunks)apps/docs/content/components/form/demo.raw.jsx
(1 hunks)apps/docs/content/components/select/virtualization-custom-item-height.raw.jsx
(1 hunks)apps/docs/content/components/select/virtualization-max-listbox-height.raw.jsx
(1 hunks)apps/docs/content/components/select/virtualization-ten-thousand.raw.jsx
(1 hunks)apps/docs/content/components/select/virtualization.raw.jsx
(1 hunks)apps/docs/content/docs/components/select.mdx
(1 hunks)packages/components/listbox/src/base/listbox-item-base.tsx
(1 hunks)packages/components/select/__tests__/select.test.tsx
(10 hunks)
✅ Files skipped from review due to trivial changes (1)
- apps/docs/content/components/form/demo.raw.jsx
🧰 Additional context used
🪛 LanguageTool
.changeset/light-hairs-draw.md
[misspelling] ~6-~6: Did you mean the auxiliary verb “does”?
Context: ...roui/select": minor --- Fix SelectItem dose not accept value props (#2283)
(DOSE_DOES)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: TypeScript
- GitHub Check: Build
🔇 Additional comments (1)
apps/docs/content/components/select/virtualization.raw.jsx (1)
Line range hint
39-48
: Verify form submission behavior after removing value prop.Please ensure that form submissions still work correctly after removing the value prop. The PR description mentions this was a fix for SelectItem not accepting value props, but we should verify that the selected values are still properly handled.
apps/docs/content/components/select/virtualization-max-listbox-height.raw.jsx
Outdated
Show resolved
Hide resolved
apps/docs/content/components/select/virtualization-custom-item-height.raw.jsx
Outdated
Show resolved
Hide resolved
🦋 Changeset detectedLatest commit: a6680b9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
Closes #2283
📝 Description
This PR includes the following changes:
value
attribute.SelectItem
to not accept avalue
prop.⛳️ Current behavior (updates)
SelectItem
accepts avalue
prop (but it is not reflected).🚀 New behavior
SelectItem
no longer accepts avalue
prop.💣 Is this a breaking change (Yes/No):
Yes
📝 Additional Information
For more details on why the
value
attribute cannot be used, please see the issue comment:#2283 (comment)
Summary by CodeRabbit
Release Notes
Bug Fixes
value
attribute fromSelectItem
components across multiple documentation and test filesListboxItemBase
component to omitvalue
propertyDocumentation
SelectItem
Dependencies
@heroui/listbox
and@heroui/select
These changes improve the consistency of
SelectItem
component usage and provide clearer guidance for developers.