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

feat(Combobox): allow custom value #14935

Merged

Conversation

tw15egan
Copy link
Collaborator

@tw15egan tw15egan commented Oct 17, 2023

Closes #14006

Adds a new prop, allowCustomValue, that will retain the value typed into the Combobox on blur, and allow the menu to be closed with Enter when the value does not match an item in the list.

Changelog

New

  • allowCustomValue prop added to ComboBox so that a user can have their value retained on Enter or Blur if it does not match any item in the list.
  • Tests to cover the new functionality
  • Docs to explain the new prop

Changed

  • Adjusted types for the onChangeData to account for this new use case

Testing / Reviewing

Go to the test story, and type in an item that is not in the item list. You should be able to accept this value with Enter, and it should stay in the Combobox when the focus is lost.

@tw15egan tw15egan requested a review from a team as a code owner October 17, 2023 20:17
@tw15egan tw15egan changed the title Combobox allow custom value feat(Combobox): allow custom value Oct 17, 2023
@tw15egan tw15egan requested a review from tay1orjones October 17, 2023 20:17
@netlify
Copy link

netlify bot commented Oct 17, 2023

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit e33818d
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/65414b1cdd10fa000863b899
😎 Deploy Preview https://deploy-preview-14935--v11-carbon-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.

@netlify
Copy link

netlify bot commented Oct 17, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit e33818d
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/65414b1c59cd4300081a8c5a
😎 Deploy Preview https://deploy-preview-14935--carbon-elements.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.

@tw15egan tw15egan requested a review from a team as a code owner October 17, 2023 20:52
Copy link
Member

@thyhmdo thyhmdo left a comment

Choose a reason for hiding this comment

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

This works great! Thank you @tw15egan

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Looks great!

@tw15egan tw15egan force-pushed the combobox-allow-custom-value branch from 25231da to 0ef61f2 Compare October 26, 2023 18:02
@github-actions github-actions bot added this pull request to the merge queue Oct 30, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 30, 2023
@tw15egan tw15egan added this pull request to the merge queue Oct 30, 2023
@tay1orjones tay1orjones removed this pull request from the merge queue due to the queue being cleared Oct 31, 2023
@tay1orjones tay1orjones enabled auto-merge October 31, 2023 18:44
@tay1orjones tay1orjones added this pull request to the merge queue Oct 31, 2023
Merged via the queue into carbon-design-system:main with commit 384dca0 Oct 31, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Combobox unique value]: New value dev implementation
5 participants