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
{{ message }}
Repository navigation
MudChipField - Required property should enforce the presence of chips #284
Currently, a MudChipField with the Required property set to true simply enforces the presence of text in the nested MudTextFieldExtended. This is counter-intuitive behaviour, as a required MudChipField should instead enforce the presense of chips.
A workaround involves adding a custom validator, however this obviously does not display errors under the chip field itself as usual.
<MudChipField T="string" Values=@chipValues Validation="@(new Func<string, IEnumerable<string>>(RequireChips))" />
@code {
private IEnumerable<string> RequireChips<T>(T newValue)
{
if (chipValues.Count == 0)
{
yield return "This field is required";
}
}
}
Activity
mckaragoz commentedon Oct 1, 2023
We can add chipfield to this:
But it doesn't solve all problems, only removes the required error text, the label still shows error color.