Skip to content
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

Need to validate nested components in EditForm #60127

Open
Bond-Addict opened this issue Jan 30, 2025 · 1 comment
Open

Need to validate nested components in EditForm #60127

Bond-Addict opened this issue Jan 30, 2025 · 1 comment
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@Bond-Addict
Copy link

This is POC repo which demonstrates the issue and what I've tried so far
https://github.com/[Bond-Addict/NestedValidation](https://github.com/Bond-Addict/NestedValidation)

I've tried several different validation libraries with no luck. This would seem to be a common use-case but I've been able to find a solution.

Issue:

When using a EditForm in a parent component, child components do not emit their validation state up to parent.

Current Attempt

Registering the EditContext as a CascadingParameter on the child. When validation is requested from the parent try and update the EditContext message store to include the invalid fields from the child.

Info:

The validators both work and validate as expected and the child component does correctly get notified when validation is requested on the EditContext.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Jan 30, 2025
@MariovanZeist
Copy link
Contributor

Hi @Bond-Addict your repo doesn't appear to exist. Did you set it to private?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

2 participants