-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Closed
Copy link
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.
Milestone
Description
Multiple ValidationMessages are generated for the same single validation.
DataAnnotationsValidator registering events by EditContextDataAnnotationsExtensions.AddDataAnnotationsValidation. If the DataAnnotationsValidator gets re-rendered, its registering same events again. It can be same EditContext though. Because its never deregistering, its registering multiple times, results in multiple ValidationMessages for the same validation.
(namespace is Microsoft.AspNetCore.Components.Forms)
minimal repro: https://github.com/rlyme/ValidationStackingRepro
- hit the "toggle visibility" button some times
- click submit
--> multiple validation messages "The Summary field is required." are displayed
ASP.NET Core version: 5.0
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.