Validationtext disappears on clicking next or save button

Hi

I have this subcomponent within a templateform which has RadzenSteps in it.
When I enter a negative number it shows the CannotBeNegative message, however when the user clicks on the buttons to go to a different step or they try to save the form, the message disappears but the page still behaves as being invalid thus preventing from going to a different step or submitting the form.
Why does the message disappear, because if I debug I see that it goes back into the ValidateNumber method when navigating to a different step or when I try to save?

image

<RadzenRow JustifyContent="JustifyContent.Normal" AlignItems="AlignItems.Start" Gap="1rem">
  <RadzenColumn>
    <QuestionTitle Prefix="@Prefix" QuestionModel="@QuestionModel"></QuestionTitle>
      <RadzenNumeric TValue="decimal?" @bind-Value="@_enteredNumber" Change="@(HandleChange)" ConvertValue="@ConvertValue"
                     Format="0.00" Name="@QuestionModel.Id.ToString()" ShowUpDown="false" class="mb-2"/>
      <RadzenCustomValidator Component="@QuestionModel.Id.ToString()" Validator="@(ValidateNumber)" 
                             Text="@(QuestionModel.FactorRangeSelection == 1 ? Localizer["CannotBeNegative"] : _validatorString)"/>
  </RadzenColumn>
  <RadzenColumn Visible="@QuestionModel.NeedsProof">
    <RadzenRow JustifyContent="JustifyContent.Start" AlignItems="AlignItems.Center" Gap="1rem">
      <AddDocument QuestionModel="@QuestionModel"/>
    </RadzenRow>
  </RadzenColumn>
</RadzenRow>
>   private bool ValidateNumber()
>   {
>     StateHasChanged();
>     if (_enteredNumber == null) return true;
>     return QuestionModel.FactorRangeSelection switch
>     {
>       1 => _enteredNumber >= 0,
>       2 => _enteredNumber > _minValue && _enteredNumber < _maxValue,
>       _ => true
>     };
>   }

Hi @TinoS,

Can you prepare some runnable reproduction for us to test? To be honest I don't think you should call StateHasChanged from ValidateNumber.