Enhance EditContext to support field-level validation state change notification#67147
Open
vendasankarsf3945 wants to merge 3 commits into
Open
Enhance EditContext to support field-level validation state change notification#67147vendasankarsf3945 wants to merge 3 commits into
vendasankarsf3945 wants to merge 3 commits into
Conversation
Author
|
@dotnet-policy-service agree company="Syncfusion, Inc." |
Contributor
|
Thanks for your PR, @vendasankarsf3945. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blazor: Add field-level validation state notification support in EditContext
Description
Adds support for field-level validation state notifications in EditContext to improve how validation updates are propagated in Blazor forms.
Currently, validation state change notifications do not provide information about the affected field, forcing consumers to treat every update as a full-form change. This makes it difficult to implement efficient, targeted validation UI updates.
This change enhances the validation notification mechanism by allowing a FieldIdentifier to be associated with validation state changes, enabling more granular handling while preserving existing behavior.
Before:
EditContext.NotifyValidationStateChanged() always triggered a global validation state change without indicating which field caused the update. As a result, consumers handling OnValidationStateChanged events could not determine the affected field and were required to reprocess the entire form even for single-field updates.
For example, custom validation components or UI logic reacting to validation changes had to refresh or re-evaluate all fields because there was no way to identify the specific field that changed.
After:
Validation state notifications can now optionally include a FieldIdentifier, allowing EditContext to notify changes for a specific field.
Consumers can now detect which field triggered the validation update and perform targeted UI updates instead of reprocessing the entire form. Existing behavior is preserved when no field is specified, ensuring full backward compatibility.
With this change, developers can build more efficient validation experiences by reacting only to the affected field rather than the entire form.
Fixes #44284