-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
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
Scenario:
<EditForm OnValidSubmit="NavigateToAnotherPage">
<input @blur="@(() => {})" />
</EditForm>Pressing "enter" inside the input causes:
System.ArgumentException: There is no event handler associated with this event. EventId: '45'.
Parameter name: eventHandlerId
at Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync (:44300/System.UInt64 eventHandlerId, Microsoft.AspNetCore.Components.RenderTree.EventFieldInfo fieldInfo, System.EventArgs eventArgs) <0x3124c68 + 0x00054> in <filename unknown>:0
at Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer.DispatchEventAsync (:44300/System.UInt64 eventHandlerId, Microsoft.AspNetCore.Components.RenderTree.EventFieldInfo eventFieldInfo, System.EventArgs eventArgs) <0x31248a0 + 0x00078> in <filename unknown>:0
at :44300/Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer.ProcessNextDeferredEventAsync () <0x3477c48 + 0x000a6> in <filename unknown>:0
at Object.endInvokeDotNetFromJS (blazor.webassembly.js:1)
at Object.invokeJSFromDotNet (blazor.webassembly.js:1)
Looks like the "navigate away" gets processed before the "blur", so the component has been disposed by the time we process its "blur" event handler.
LaughingJohn, jespersh and Krisff
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.