Skip to content

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

Open

Description

@SpicyBoyd

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.

Activity

  1. konst-sh commented on Aug 16, 2025

    @konst-sh

    maybe related - with SelectExtended once the option picked and I'm calling componentReference.Clear() or _.ResetAsync() in OnChanged handler I'm expecting that same option would be possible to select again, but but the handler will not react again unless I'm switch to some another option and switch back. So Clear() or ResetAsync() seem to not actually resetting internal state completely.

  2. cherepakhina commented on Sep 30, 2025

    @cherepakhina

    Hey, have either of you found a workaround for this that doesn't involve binding a single value to SelectedValues? I'm experiencing the same issue (I need to reset the value to null but neither setting it to null directly nor Clear()/ResetAsync() work).

  3. konst-sh commented on Sep 30, 2025

    @konst-sh

    @cherepakhina my workaound looking like this: assigning null to the value, which makes the handler to run twise on every user selection, and using the boolean field inserted to check if handler been executed with non-trivial argument, and resetting it.

    @ref="selectExtended2"
    Value="null"
    ValueChanged="@(async data => {
            if (data is not null && !inserted) { 
    //here you place actual logic to run
                 inserted = true; 
            }
            else inserted = false;
         await selectExtended2!.ResetAsync();
    })"
  4. JakubTracz commented on Dec 13, 2025

    @JakubTracz

    Hi, are there any plans to have it fixed? Thanks

  5. added
    bug
    on Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions