radzen-blazor icon indicating copy to clipboard operation
radzen-blazor copied to clipboard

RadzenDropDown unexpected item change on reload page

Open lg2de opened this issue 10 months ago • 0 comments

Today (with version 7.1.1) I faced an issue which seems to be present already several time (also verified in 5.9.7). A RadzenDropDown gets unexpected call of SelectedItemChanged or Change event when page gets reloaded manually by pressing function key F5. But, this problem only apears when the drop down was opened.

Sample code in your razor page:

List<string> stringList = ["Option1", "Option2", "Option3"];
string selectedItem = stringList[1];
<RadzenDropDown
    Data="@stringList"
    @bind-Value="@selectedItem"
    SelectedItemChanged="o => Console.WriteLine(o)"/>

To Reproduce

  1. Load the page - Option2 is selected, no Console output visible -> ok
  2. Reload the page - Option2 is selected, no Console output visible -> ok
  3. Select Option3 - Option3 is selected, Option3 is written to Console output -> ok
  4. Reload the page - Option1 is visible as selected very shortly before page gets reloaded, Option1 is written to Console output -> not ok (Option2 gets selected as expected)
  5. Reload the page - Option2 is selected, no Console output visible -> ok
  6. Just open the DropDown and reload the page - Option1 is visible as selected very shortly before page gets reloaded, Option1 is written to Console output -> not ok (Option2 gets selected as expected)
  7. Reload the page - Option2 is selected, no Console output visible -> ok

Expected behavior Option1 must not get selected item if not selected explicitly by the user.

Screenshots N/A

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Tested with Vivalidi (7.4.3684.55) and Chrome (137.0.7151.104)

lg2de avatar Jun 21 '25 15:06 lg2de