SfComboBox Selection Box Blank After Selection Until Clear Button Pressed

41 Views Asked by At

I'm trying to get Syncfusion SfComboBox (24.2.9) to work in .NET MAUI (8.0.201) for Mac Catalyst with UIDeviceFamily 6.

With IsClearButtonVisible false, the selection box remains blank after making a selection.

With IsClearButtonVisible true, I get the same behavior except the clear button appears after the first selection (with blank selection box). Then if I press the clear button, subsequent selections appear in the selection box.

Please see code below.

I've tried setting ItemsSource in the XAML and specifying TextColor with the same result.

This seems like a bug. Any ideas?

Thanks!

XAML:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:Test"
             xmlns:sfinputs="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
             Shell.NavBarIsVisible="false"
             x:Class="Test.MainPage"
             x:DataType="local:MainViewModel">

    <sfinputs:SfComboBox
        ItemsSource="{Binding BoxTest}"
        IsClearButtonVisible="false" />

    <sfinputs:SfComboBox
        ItemsSource="{Binding BoxTest}" />
    
</ContentPage>

C#:

public partial class MainViewModel : ObservableObject
{

    [ObservableProperty]
    private ObservableCollection<string> boxTest;

    public MainViewModel()
    {
        BoxTest = ["Choice 1", "Choice 2"];
    }

}
1

There are 1 best solutions below

0
Eggsalad On

Answered on Syncfusion forum: https://www.syncfusion.com/forums/187246/sfcombobox-selection-box-blank-after-selection-until-clear-button-pressed?reply=z9w0ek

It's a text visibility bug in .NET. Workaround is to reset text color in SelectionChanged handler.