-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Labels
Pillar: Technical DebtPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releasearea-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
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
We noticed after upgrading our blazor application to .net 8.0 that some EventCallback keep being modified. Eventhough the value was the same, the same target component, the same method.
The generated code that renders the component seems to fabricate a new MulticastDelegate, having the same Type, Target and Method. The implementation of EventCallback uses Object.ReferenceEquals, so it concludes it is different every render.
Expected Behavior
The component should see EventCallbacks as equal when the delegate and Target are the same. MulticastDelegate has the Equals method overridden, so use that instead of ReferenceEquals.
Steps To Reproduce
I will make a PR with a fix
Exceptions (if any)
No response
.NET Version
8.0.101
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Pillar: Technical DebtPriority:2Work that is important, but not critical for the releaseWork that is important, but not critical for the releasearea-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.