Skip to content

Commit

Permalink
Fixed bug where ChipSelect initial values where not correctly selected.
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix-CodingClimber committed Feb 29, 2024
1 parent 0915df8 commit 2c30bde
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DotNetElements.Web.MudBlazor/ChipSelect.razor
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
[Parameter, EditorRequired]
public List<T> SelectedItems { get; set; } = default!;

[Parameter, EditorRequired]
public Func<IEnumerable<T>> InitialSelectedItemsFunc { get; set; } = default!;

// todo update logic 2 (check which of the two update logics are better)
// [Parameter]
// public EventCallback<List<T>> SelectedItemsChanged { get; set; }
Expand Down Expand Up @@ -137,7 +140,7 @@

protected override void OnInitialized()
{
selectedItems_Internal = [.. SelectedItems];
selectedItemsBinding = new HashSet<T>(InitialSelectedItemsFunc.Invoke());
}

protected override void OnParametersSet()
Expand Down

0 comments on commit 2c30bde

Please sign in to comment.