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
If you put the step in a separate component, validation stops working.
Even if EditEnabled contains the exact same code as in the first step, it validates 1 time, fails to show the actual error messages, and next time you click next it proceeds as if validation succeeded.
I have debugged it down to Dispose is called on DataAnnotationsValidator, cannot figure out why it gets disposed in the first place. The subcomponent itself does not gets disposed if you implement IDisposable.
The text was updated successfully, but these errors were encountered:
I am not entirely sure without more code, but are you sure the steps are rendered whenever you step to another step? If the first step is not rendered anymore as you move to the 2nd step, then all the context and the data annotations validator might be disposed and not available in the second component?
For example.. how can the 2nd step reach the Cascading edit context of the first step if the EditForm is not wrapping that step?
I'm wondering whether this requires the use of <ObjectGraphDataAnnotationsValidator /> instead of <DataAnnotationsValidator/>. You can use [ValidateComplexType] to validate complex objects within the context.
It's not a guaranteed fix, but it's usually my first port of call when dealing with nested validation issues.
vnbaaij
added
needs: author feedback
The author of this issue needs to respond in order for us to continue investigating this issue.
and removed
triage
New issue. Needs to be looked at
labels
May 4, 2025
🐛 Bug Report
If you put the step in a separate component, validation stops working.
Even if
EditEnabled
contains the exact same code as in the first step, it validates 1 time, fails to show the actual error messages, and next time you click next it proceeds as if validation succeeded.💻 Repro or Code Sample
🤔 Expected Behavior
I can put each step in a sub component
😯 Current Behavior
Validate breaks when put in sub component
💁 Possible Solution
I have debugged it down to
Dispose
is called onDataAnnotationsValidator
, cannot figure out why it gets disposed in the first place. The subcomponent itself does not gets disposed if you implement IDisposable.The text was updated successfully, but these errors were encountered: