Skip to content

"There is no event handler associated with this event" when an element is focused out #26838

Closed
@Stamo-Gochev

Description

@Stamo-Gochev

Describe the bug

An error is thrown:

Error: System.ArgumentException: There is no event handler associated with this event. EventId: '3'. (Parameter 'eventHandlerId')

when an element with focusout handler is removed from the DOM in a blazor wasm app (both 3.1 and 5.0).

To Reproduce

  1. Clone the https://github.com/Stamo-Gochev/blazor-net5-wasm-focusout repository
  2. Set the TestNet5Wasm.Server as a startup project.

Note: In order to test the 3.1 version of wasm, use the TestNet31Wasm.Server

  1. Run the app (Ctrl + F5)
  2. On the Index.razor page, click on item 2 that has @onfocusout handler

Note: The main logic is part of the Index.razor page only and the script.js file.

Exceptions (if any)

Error: System.ArgumentException: There is no event handler associated with this event. EventId: '3'. (Parameter 'eventHandlerId')

Further technical details

  • ASP.NET Core version 3.1, 5.0 RC1
  • Include the output of dotnet --info
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and it's version

Additional context

A similar problem is marked to be fixed in multiple cases like:
#17926
#21241
#21366
#21874 (comment)

but the problem is still reproducible in both the 3.1 and 5.0 versions.

Metadata

Metadata

Labels

DoneThis issue has been fixedaffected-mediumThis issue impacts approximately half of our customersarea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyseverity-majorThis label is used by an internal tool

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions