-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Support multiple event handlers for the same event on the same element #14365
Copy link
Copy link
Closed
Labels
Components Big RockThis issue tracks a big effort which can span multiple issuesThis issue tracks a big effort which can span multiple issuesNeeds: DesignThis issue requires design work before implementating.This issue requires design work before implementating.Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutaffected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-component-modelAny feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc)Any feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc)severity-majorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
Components Big RockThis issue tracks a big effort which can span multiple issuesThis issue tracks a big effort which can span multiple issuesNeeds: DesignThis issue requires design work before implementating.This issue requires design work before implementating.Priority:1Work that is critical for the release, but we could probably ship withoutWork that is critical for the release, but we could probably ship withoutaffected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-component-modelAny feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc)Any feature that affects the component model for Blazor (Parameters, Rendering, Lifecycle, etc)severity-majorThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently, Blazor only allows a single
onsomethingfor a given element. A consequence of this is that:@bindyou can't also use@onchange(because the framework is using it)@bind:event="oninput"you can't also use@oninput(because the framework is using it)This is a limitation we should be able to relax, and would help fix issues like #14242 (comment)
Ways we could fix it:
@onsomeevent(including ones it creates itself via@bind) and collapse them into a single@onsomeeventthat calls a code-genned method that runs all the handlers.StateHasChangedcalls that run after each of the returned tasks complete, so as to preserve the usual updating behavior?