Skip to content

WebEventDescriptor.EventArgsType replaced by WebEventDescriptor.EventName #453

@SteveSandersonMS

Description

@SteveSandersonMS

WebEventDescriptor.EventArgsType replaced by WebEventDescriptor.EventName

The Microsoft.AspNetCore.Components.RenderTree.WebEventDescriptor class is part of Blazor's internal protocol for communicating events from JavaScript into .NET. This class is not typically used by application code. It is typically used only by platform authors.

Starting from version 6.0, the EventArgsType property on WebEventDescriptor is being replaced by a new property called EventName. This will not affect any typical application code as it is only a detail of the low-level platform implementation.

Version introduced

6.0

Old behavior

The property EventArgsType described a nonstandard, Blazor-specific category name for groups of DOM event types. For example, the click and mousedown events were both mapped to an EventArgsType value of mouse. Similarly, cut, copy, and paste events were all mapped to an EventArgsType value of clipboard. These category names were used to determine the .NET type to use for deserializing the incoming event args data.

New behavior

The new property EventName simply specifies the original name of the event, for example click, mousedown, cut, copy, or paste. There is no longer a need to supply a Blazor-specific category name, so the old property EventArgsType is removed.

Reason for change

In PR #29993 we have introduced support for custom event arguments classes. As part of this, we no longer rely on all events fitting into a predefined set of categories. The framework now only needs to know the original, raw event name.

Recommended action

Application code should not be affected in any way and does not need to change.

Anyone building a custom Blazor rendering platform may need to update their mechanism for dispatching events into the Renderer, replacing any hardcoded rules they had before about event categories with simpler logic that supplies the original, raw event name.

Category

ASP.NET

Affected APIs

WebEventDescriptor.EventArgsType property


Issue metadata

  • Issue type: breaking-change

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions