AlaskaAirlines / auro-combobox

An auroLabs custom element w/an experimental API. You've been warned.
https://auro.alaskaair.com/components/auroLabs
Apache License 2.0
4 stars 1 forks source link

auro-combobox: Custom validation #146

Open tfales opened 1 year ago

tfales commented 1 year ago

Is your feature request related to a problem? Please describe.

Problem: no custom validation supported at this time, unlike other Auro components.

Describe the solution you'd like

Add control around custom validation state and error handling.

One use I could see for this component is a search-based dropdown. Let's say we want to use this combobox as a select/dropdown that contains 200+ options (like selecting a country, for example). With current implementation, I could type 'United St' to display an option 'United States'. However, if the option isn't selected, or fully filled out, 'United St' is a totally valid, accepted value.

I suggest allowing for custom validation so that consumer could compare the search string against the list of options and validate a match (i.e. make 'United St' invalid until the value matches 'United States'), with support for custom error verbiage. This functionality is supported in other Auro components, such as the Input component.

Describe alternatives you've considered

Alternatively, add an enhancement to the Auro Select component to allow typing/search functionality.

Additional context

No response