In the following MudSelect code:
<MudSelect @bind-Value="value" T="string" Label="Test Select" Error="@isInError" ErrorText="The field is in error"> @foreach(string option in options) {<MudSelectItem T="string" Value="@option">@option</MudSelectItem> }</MudSelect><MudButton ButtonType="ButtonType.Button" onclick="@Validate">Validate</MudButton>@code { private bool isInError = false; private string value = string.Empty; private List<string> options = ["opt1", "opt2", "opt3", "opt4"]; private void Validate() { if (value == string.Empty) { isInError = true; } }}
Code snippet: https://try.mudblazor.com/snippet/QuczkymnkhIRBAhH
If you select no option and click on the validate button, the error message appears (as expected).
But when you select an option, the error message disappears and the highlighting changes back to normal state.
I don't want this. I only want the error processing to happen on the validate click primarily as the error may not be related to the field being blank or not. There are also other components on the screen that don't suffer from the same behaviour, like MudTextField.
I cannot seem to find anything on the issues log relating to this. I'm using mudblazor v8.5.1.
Does anyone have any ideas on how to fix this?