Open
Description
🐛 Bug Report
Create an edit form with data validation, and insert a FluentNumberField.
When you enter a number large than the maximum allowed (or presumably lower than the minimum allowed), you get a validation error "The {property} field must be a number.". When you then enter a more sensible value, the validation error remains and the form remains unsubmittable and the form will not work until it is recreated.
💻 Repro or Code Sample
<EditForm EditContext="EditContext">
<DataAnnotationsValidator />
<FluentNumberField @bind-Value="MyModel.MyInt" Label="My Int" Immediate="true" />
<FluentValidationMessage For="() => MyModel.MyInt" />
</EditForm>
@code {
Model MyModel { get; set; } = new();
EditContext EditContext { get; set; } = default!;
protected override void OnInitialized()
{
base.OnInitialized();
EditContext = new(MyModel);
}
public class Model
{
public int MyInt { get; set; }
}
}
- Enter "1" in the box
- Repeatedly enter "0" after the current value in the box until the error appears
- Remove 0's and notice that the box never validated correctly and the form is now unusable
🤔 Expected Behavior
Error message should represent the actual issue, not state that it is not a number.
Then, when number is corrected, the field and form should operate correctly once again.
😯 Current Behavior
💁 Possible Solution
🔦 Context
This makes using NumberFields and form validation difficult to justify.
🌍 Your Environment
- OS & Device: Windows
- Browser Chrome (Latest)
- .NET 8, FluentUI 4.3.1