I have a multi-tabed form with an editcontext on each one. When on a tab a field is made invalid, the error message appears. When I switch tabs and go back, the error message is gone. After this, if I enter a valid input then make it invalid again, there is no error messsage.
Here is the tab component TabUIAddUpdateCancelComponent with _editContext being set by a parameter.
<EditForm id="modelForm" EditContext="_editContext" OnValidSubmit="UpdateElement" OnInvalidSubmit="HandleInvalidSubmit"><DataAnnotationsValidator /><ValidationSummary /> @ChildContent<div class="self-end"><button type="submit" class="btn btn-primary fr mt4 ph6 pv3" @onmousedown="HandleMouseDown"> @if (!InCreateMode) {<div>Update</div> } else {<div>Create</div> }</button> @if (ShowCancelButton) {<button class="btn btn-danger fr mt4 ph6 pv3" @onclick="@CancelUpdateOrAdd"><div>Cancel</div></button> }</div></EditForm>It gets used here:
<TabUiControl ButtonCss="w-third" @ref="_tabsUiControl" OnTabUiControlClick="@TruckEditTabUiChanged"><TabUiComponent IconCss="fas fa-building" Text="Basic Information" @ref="_TruckBasicComponent" IsDisabled="@false"><TabUiContainerComponent OnTabUiContainerClick="@TruckEditTabUiChanged"><TabUIAddUpdateCancelComponent InCreateMode="IsFirstTimeTruck" ShowCancelButton="IsFirstTimeTruck" ElementId="_formModelTruck.Dimensions.TractorId" OnUpdate="OnUpdate" OnDelete="OnDelete" OnCancel="OnCancel" EditContext="new EditContext(_formModelTruck)"><TruckEditBasic FullTruck="_formModelTruck" /></TabUIAddUpdateCancelComponent></TabUiContainerComponent></TabUiComponent><TabUiComponent IconCss="fas fa-building" Text="Operations" @ref="_TruckOperationsComponent" IsDisabled="@false"><TabUiContainerComponent OnTabUiContainerClick="@TruckEditTabUiChanged"><TabUIAddUpdateCancelComponent InCreateMode="IsFirstTimeTruck" ShowCancelButton="IsFirstTimeTruck" ElementId="_formModelTruck.Dimensions.TractorId" OnUpdate="OnUpdate" OnDelete="OnDelete" OnCancel="OnCancel" EditContext="new EditContext(_formModelTruck)"><TruckEditOperations FullTruck="_formModelTruck" /></TabUIAddUpdateCancelComponent></TabUiContainerComponent></TabUiComponent>...The _formModelTruck class contains three other classes. Each of these classes contain the validation requirements and are simple types.
public class FormModelTruck { public Tractor? Detail { get; set; } = null; public TractorDimensions? Dimensions { get; set; } = null; public TruckCustomDimensions? CustomDimensions { get; set; } = null; }