kobalte icon indicating copy to clipboard operation
kobalte copied to clipboard

add `allowsCustomValue` to Combobox

Open AlexErrant opened this issue 1 year ago • 2 comments

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 :)

  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!

AlexErrant avatar Oct 04 '24 02:10 AlexErrant

Deploy request for kobalte pending review.

Visit the deploys page to approve it

Name Link
Latest commit f08daa22e5c5491c3c9478cd27d1007a56550184

netlify[bot] avatar Oct 04 '24 02:10 netlify[bot]

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.

jer3m01 avatar Oct 05 '24 16:10 jer3m01