From 2c30bde615f136fe0f6258d8f57713c7a1c26e6e Mon Sep 17 00:00:00 2001 From: Felix-CodingClimber Date: Thu, 29 Feb 2024 22:08:17 +0100 Subject: [PATCH] Fixed bug where ChipSelect initial values where not correctly selected. --- src/DotNetElements.Web.MudBlazor/ChipSelect.razor | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/DotNetElements.Web.MudBlazor/ChipSelect.razor b/src/DotNetElements.Web.MudBlazor/ChipSelect.razor index 0be6101..40d208a 100644 --- a/src/DotNetElements.Web.MudBlazor/ChipSelect.razor +++ b/src/DotNetElements.Web.MudBlazor/ChipSelect.razor @@ -93,6 +93,9 @@ [Parameter, EditorRequired] public List SelectedItems { get; set; } = default!; + [Parameter, EditorRequired] + public Func> InitialSelectedItemsFunc { get; set; } = default!; + // todo update logic 2 (check which of the two update logics are better) // [Parameter] // public EventCallback> SelectedItemsChanged { get; set; } @@ -137,7 +140,7 @@ protected override void OnInitialized() { - selectedItems_Internal = [.. SelectedItems]; + selectedItemsBinding = new HashSet(InitialSelectedItemsFunc.Invoke()); } protected override void OnParametersSet()