Skip to content
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: Chakra-ui SelectWidget to show proper selection #3429

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

heath-freenome
Copy link
Member

Reasons for making this change

Fixes: #3422 by using the selected value for the single selection

  • Updated the @rjsf/chakra-ui SelectWidget to properly use the selected value rather than a hard-coded 0 value
  • Updated the CHANGELOG.md accordingly

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@@ -70,7 +71,7 @@ export default function SelectWidget<
)
? enumOptions.map((option: EnumOptionsType<S>, index: number) => {
const { value, label } = option;
_valueLabelMap[index] = label;
_valueLabelMap[index] = label || String(value);
Copy link
Member Author

Choose a reason for hiding this comment

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

If no label, fall-back to the stringified value (same as the code below, but better here)

@heath-freenome heath-freenome changed the title Fix: Chakra-ui SelectWidget show proper selection Fix: Chakra-ui SelectWidget to show proper selection Feb 3, 2023
Fixes: rjsf-team#3422 by using the selected value for the single selection
- Updated the `@rjsf/chakra-ui` `SelectWidget` to properly use the selected value rather than a hard-coded `0` value
- Updated the `CHANGELOG.md` accordingly
@heath-freenome heath-freenome merged commit c4f76ca into rjsf-team:main Feb 3, 2023
@heath-freenome heath-freenome deleted the fix-3422 branch February 3, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enum select forms do not update their value in the ui - charka-ui theme
2 participants