You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there anyway we can expose something like a isValid callback for calcite-combobox-item or calcite-combobox so we can validate the item the user adds before actually add it to the combobox ❓
We're having a tag list feature for items and one of the issue came up is that tags that have trailing/leading spaces are considered as separated tags. So, I think having a callback to validate the tag before adding it to the combobox would be the solution in the long run
/** * When provided, this method will be called before a custom value is added. * Depends on 'allowCustomValues' being true. */
@Prop()beforeAddCustomValue?: ()=>Promise<void>;
I would change the promise signature slightly so that the resolved value is what we use for the custom value. That way a dev could transform things if need be (ie escape certain chars, dedupe things, etc). If resolved with a falsey value this could stop the addition entirely?
Question
Is there anyway we can expose something like a
isValid
callback forcalcite-combobox-item
orcalcite-combobox
so we can validate the item the user adds before actually add it to thecombobox
❓We're having a tag list feature for items and one of the issue came up is that tags that have trailing/leading spaces are considered as separated tags. So, I think having a callback to validate the tag before adding it to the combobox would be the solution in the long run
cc @paulcpederson
The text was updated successfully, but these errors were encountered: