Blazor: Separate Validate/StateChange concerns in EditContext #13595
Labels
affected-few
This issue impacts only small number of customers
area-blazor
Includes: Blazor, Razor Components
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
feature-blazor-builtin-components
Features related to the built in components we ship or could ship in the future
feature-blazor-form-validation
This issue is related to forms validation in Blazor
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
severity-minor
This label is used by an internal tool
Status: Resolved
Milestone
Is your feature request related to a problem? Please describe.
It is currently not possible to validate an individual field of an EditForm without also marking the field as modified.
Currently we can call EditContext.NotifyFieldChanged to invoke validation, but that also sets the FieldState.IsModified to true for that item in the form.
Describe the solution you'd like
Please separate change notification and validation requests for properties, so we can validate without marking the state as modified.
Add a
ValidateProperty(FieldIdentifier)
method to EditContext which invokes anOnFieldValidationRequested
event that validation strategies can use to trigger validation.NotifyFieldChanged
andOnFieldChanged
should remain as it might be useful to know when an individual property is changed.The text was updated successfully, but these errors were encountered: