CodeBeam.MudBlazor.Extensions icon indicating copy to clipboard operation
CodeBeam.MudBlazor.Extensions copied to clipboard

MudSelectExtended: cannot re-select previously selected option after programmatic change

Open SpicyBoyd opened this issue 3 months ago • 3 comments
trafficstars

What went wrong?

After selecting “A” in a MudSelectExtended, calling its ValueChanged callback in code to set the value to “B” works—but then clicking “A” again in the dropdown does not fire ValueChanged, so you can never go back to “A.”

Reproduction steps

  1. Create a page with:
<MudSelectExtended T="string"
                   Label="RenderFragment Based"
                   Value="@Test"
                   ValueChanged="TestValueChanged">
  <MudSelectItemExtended Value="Foo" Text="Foo" />
  <MudSelectItemExtended Value="Bar" Text="Bar" />
  <MudSelectItemExtended Value="Fizz" Text="Fizz" />
  <MudSelectItemExtended Value="Buzz" Text="Buzz" />
</MudSelectExtended>

<MudButton OnClick="()=>TestValueChanged("Fizz")">Test</MudButton>

@code {
  private string Test;

  private void TestValueChanged(string value)=>Test = value;
}
  1. Run, open dropdown, select Foo.
  2. Click the Test button to programmatically change the value to Fizz.
  3. Open dropdown again and select Foo — TestValueChanged("Foo") does not fire.

Expected behavior

After programmatically changing Value to “Fizz,” selecting “Foo” again should fire ValueChanged("Foo") and update the bound value.

Actual behavior

The UI shows Foo as selected in the list, but ValueChanged is never called, and the bound value remains “Fizz.”

Workarounds tried

Temporary: bind via SelectedValues="[Test]", which allows selecting the same item again but is not ideal for single-value scenarios.

SpicyBoyd avatar Aug 05 '25 03:08 SpicyBoyd