Skip to content

Blazor: Separate Validate/StateChange concerns in EditContext #13595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mrpmorris opened this issue Aug 31, 2019 · 5 comments
Closed

Blazor: Separate Validate/StateChange concerns in EditContext #13595

mrpmorris opened this issue Aug 31, 2019 · 5 comments
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

Comments

@mrpmorris
Copy link

mrpmorris commented Aug 31, 2019

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.

@pranavkm pranavkm added the area-blazor Includes: Blazor, Razor Components label Sep 2, 2019
@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Sep 3, 2019
@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Sep 3, 2019
@mkArtakMSFT
Copy link
Contributor

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
Copy link
Author

I'll happily provide the resources, it's only a few lines of code :)

@mrpmorris
Copy link
Author

Could this be considered please? It allows the validation of a sub-set of object properties without having to mark them as modified.

@mkArtakMSFT
Copy link
Contributor

@SteveSandersonMS thoughts?

@SteveSandersonMS SteveSandersonMS added affected-few This issue impacts only small number of customers severity-minor This label is used by an internal tool labels Oct 14, 2020 — with ASP.NET Core Issue Ranking
@javiercn javiercn added the feature-blazor-builtin-components Features related to the built in components we ship or could ship in the future label Apr 19, 2021
@mkArtakMSFT mkArtakMSFT added the feature-blazor-form-validation This issue is related to forms validation in Blazor label Oct 19, 2022
@mkArtakMSFT
Copy link
Contributor

Closing as this is a dupe of #31252

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2022
@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Oct 19, 2022
@ghost ghost added the Status: Resolved label Oct 19, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Nov 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

5 participants