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

add allowsCustomValue to Combobox #495

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexErrant
Copy link

@AlexErrant AlexErrant commented Oct 4, 2024

Closes #491

Name taken from https://react-spectrum.adobe.com/react-spectrum/ComboBox.html#custom-value

I'm seeking approval on the overall architecture of this feature before I flesh out the below 2 features. No sense in building a bunch of logic if it doesn't suit the architecture/goals of this project :)

  1. It requires at least one more ComboboxBaseOptions, perhaps named customValueToOption, that takes a string (e.currentTarget.value) and returns an Option.

  2. Another ComboboxBaseOptions could be a customValueValidator since it's relatively easy for users to add an emptystring Option which probably isn't desirable.

...now that I think about it some more, an even better path would be to combine the above 2 bulletpoints and call it customValueParser (shoutout to this article).

I only manually tested using this commit, perhaps more rigorous testing is required - please LMK!

Copy link

netlify bot commented Oct 4, 2024

👷 Deploy request for kobalte pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit f08daa2

@AlexErrant AlexErrant changed the title add allowsCustomValue add allowsCustomValue to Combobox Oct 4, 2024
@jer3m01
Copy link
Member

jer3m01 commented Oct 5, 2024

Hey, thanks for the PR draft!

I'll look into your suggestions and the best way to implement this.
Will get back to you soon.

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.

[Combobox] allow programatically changing the input value
2 participants