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

chore(SingleSelect): SingleSelect - Controlled Component #319

Merged
merged 9 commits into from
Apr 4, 2024

Conversation

shindigira
Copy link
Contributor

@shindigira shindigira commented Mar 6, 2024

closes #318

Changes

  • SelectSingle refactored to be controlled
  • new SelectSingle/SelectMulti prop: defaultOptionLabel = '-- select an option --'

How to Test

  • Use the SingleSelect story to verify functionality

Notes

  • See the Select.stories.tsx on implementation use

Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for cfpb-design-system-react ready!

Name Link
🔨 Latest commit 04ccef2
🔍 Latest deploy log https://app.netlify.com/sites/cfpb-design-system-react/deploys/660ed75df5a8470008b31b72
😎 Deploy Preview https://deploy-preview-319--cfpb-design-system-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shindigira shindigira changed the title refactor(SingleSelect): SingleSelect - Controlled Component chore(SingleSelect): SingleSelect - Controlled Component Mar 7, 2024
src/components/Select/Select.stories.tsx Outdated Show resolved Hide resolved
src/components/Select/Select.stories.tsx Show resolved Hide resolved
src/components/Select/Select.stories.tsx Show resolved Hide resolved
meissadia
meissadia previously approved these changes Mar 12, 2024
Copy link
Contributor

@meissadia meissadia left a comment

Choose a reason for hiding this comment

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

Looking good. One small change to reduce console noise.

src/components/Select/selectUtils.tsx Outdated Show resolved Hide resolved
@shindigira
Copy link
Contributor Author

@meissadia Can test the new prop -- defaultOptionLabel = '-- select an option --' that I added.

meissadia
meissadia previously approved these changes Apr 1, 2024
Copy link
Contributor

@meissadia meissadia left a comment

Choose a reason for hiding this comment

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

defaultOptionLabel was a nice addition, looks good!

@shindigira
Copy link
Contributor Author

@meissadia Updated SingleSelect tests. Will need a re-review when convenient!

@shindigira shindigira merged commit 5e4b790 into main Apr 4, 2024
7 of 9 checks passed
@shindigira shindigira deleted the Single-Select-Fixes branch April 4, 2024 16:52
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.

[Select][SingleSelect] changed to be controlled (displayed uses 'value')
3 participants