-
Notifications
You must be signed in to change notification settings - Fork 436
Open
Labels
status:needs-investigationNeeds additional investigationNeeds additional investigation
Description
🐛 Bug Report
See sample below...
- click 'Load Existing'
- If
staticform-reset
hasdata-enhance
then html will correctly update to<fluent-number-field class="valid" maxlength="14" minlength="1" size="20" step="1" id="f688f055" value="42" name="Model.Age" appearance="outline">
, but the actual input inside will not get updated - if no
data-enhance
, the problem goes away. - if using any @rendermode problem goes away. It only happens in SSR.
💻 Repro or Code Sample
@page "/staticform"
<EditForm Model="@Model" OnValidSubmit="@HandleValidSubmit" FormName="staticform">
<DataAnnotationsValidator />
<FluentNumberField Name="@FieldName(Model.Age)" @bind-Value="Model.Age" Label="Age" />
</EditForm>
<form method="post" data-enhance @onsubmit="@Load" @formname="staticform-reset">
<AntiforgeryToken/>
<FluentButton Type="ButtonType.Submit" Appearance="Appearance.Stealth">Load Existing</FluentButton>
</form>
@code {
private static string FieldName(object propertyName, [CallerArgumentExpression(nameof(propertyName))] string? memberName = null) => memberName!;
[SupplyParameterFromForm] private FormModel? Model { get; set; }
private bool formSubmitted = false;
protected override void OnInitialized() => Model ??= new();
private void HandleValidSubmit()
{
formSubmitted = true;
}
private void Load()
{
Model = new(){Age = 42};
formSubmitted = false;
}
public class FormModel
{
[Range(18, 120)] public int Age { get; set; } = 18;
}
}
Metadata
Metadata
Assignees
Labels
status:needs-investigationNeeds additional investigationNeeds additional investigation