kobalte
kobalte copied to clipboard
add `allowsCustomValue` to Combobox
Closes https://github.com/kobaltedev/kobalte/issues/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 :)
-
It requires at least one more
ComboboxBaseOptions, perhaps namedcustomValueToOption, that takes a string (e.currentTarget.value) and returns anOption. -
Another
ComboboxBaseOptionscould be acustomValueValidatorsince it's relatively easy for users to add an emptystringOptionwhich 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!
Deploy request for kobalte pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | f08daa22e5c5491c3c9478cd27d1007a56550184 |
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.