You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Blazor: Separate Validate/StateChange concerns in EditContext #13595
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 an OnFieldValidationRequested event that validation strategies can use to trigger validation.
NotifyFieldChanged and OnFieldChanged should remain as it might be useful to know when an individual property is changed.
We've moved this issue to the Backlog milestone. This means that it is not going to happen for the coming release. We will reassess the backlog following the current release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.
Activity
mkArtakMSFT commentedon Sep 3, 2019
We've moved this issue to the Backlog milestone. This means that it is not going to happen for the coming release. We will reassess the backlog following the current release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.
mrpmorris commentedon Sep 4, 2019
I'll happily provide the resources, it's only a few lines of code :)
mrpmorris commentedon Feb 6, 2020
Could this be considered please? It allows the validation of a sub-set of object properties without having to mark them as modified.
mkArtakMSFT commentedon Feb 10, 2020
@SteveSandersonMS thoughts?
mkArtakMSFT commentedon Oct 19, 2022
Closing as this is a dupe of #31252