Skip to content

Blazor InputRadio is broken by IHandleEvent #52069

@plastovicka

Description

@plastovicka

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

If a Blazor page implements IHandleEvent to optimize rendering speed according to performance best practices, then all input radios are broken. After a radio button is clicked, it is instantly rendered back to its previous state. Then it looks like the value was not changed. The problem started after upgrade to .Net 8.

Expected Behavior

It worked in .Net 7.

Steps To Reproduce

@page "/"
@implements IHandleEvent

<InputRadioGroup @bind-Value="n">
  <InputRadio Value="0" />
  <InputRadio Value="1" />
</InputRadioGroup>

@code {
  int n;

  Task IHandleEvent.HandleEventAsync(EventCallbackWorkItem callback, object? arg) => callback.InvokeAsync(arg);
}

Exceptions (if any)

No response

.NET Version

8.0.100

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-blazor-builtin-componentsFeatures related to the built in components we ship or could ship in the future

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions