diff --git a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml index 3d08fa5b1b..cc986078d9 100644 --- a/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml +++ b/examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml @@ -1794,6 +1794,14 @@ + + + Gets or sets the equality comparer used to determine whether two grid items are equal. + + If not set, the default equality comparer for is used. + Setting this property allows customization of how grid items are compared for equality, which can affect + operations such as selection, filtering, or updating items in the grid. + Allows to clear the selection. diff --git a/src/Core/Components/List/FluentCombobox.razor.cs b/src/Core/Components/List/FluentCombobox.razor.cs index 9c77ae078d..2c318dfd62 100644 --- a/src/Core/Components/List/FluentCombobox.razor.cs +++ b/src/Core/Components/List/FluentCombobox.razor.cs @@ -141,7 +141,7 @@ public override async Task SetParametersAsync(ParameterView parameters) protected override async Task ChangeHandlerAsync(ChangeEventArgs e) { - if (e.Value is not null && Items is not null) + if (e.Value is not null && Items is not null ) { var value = e.Value.ToString(); var item = Items.FirstOrDefault(i => GetOptionText(i) == value); @@ -171,7 +171,7 @@ protected override async Task ChangeHandlerAsync(ChangeEventArgs e) } else { - return null; + return Value; } } diff --git a/tests/Core/List/FluentComboboxTests.FluentCombobox_ClearSelection.verified.html b/tests/Core/List/FluentComboboxTests.FluentCombobox_ClearSelection.verified.html index d26baf656f..73b6c67b00 100644 --- a/tests/Core/List/FluentComboboxTests.FluentCombobox_ClearSelection.verified.html +++ b/tests/Core/List/FluentComboboxTests.FluentCombobox_ClearSelection.verified.html @@ -1,5 +1,5 @@ - + Contoso - + \ No newline at end of file