Skip to content

Picker not working on macOS #21691

@andrewstellman

Description

@andrewstellman

Description

The Picker control seems to be broken on macOS.
On macOS, clicking on the Picker displays a dialog that shows the title and a "Done" button but doesn't display the items:

image

Here's a video that shows it in action:

ReproduceMauiPickerIssue.mov

I'm running it on the latest 8.0 GA SDK:

andrewstellman@Andrews-MBP reproduce-maui-picker-issue % dotnet workload list

Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------
maui                       8.0.7/8.0.100         SDK 8.0.200        

Use `dotnet workload search` to find additional workloads to install.

andrewstellman@Andrews-MBP reproduce-maui-picker-issue % dotnet build -t:Run -f net8.0-maccatalyst

Welcome to .NET 8.0!
---------------------
SDK Version: 8.0.203

This same code works fine on Windows and Android:

Windows:
image

Android:
image

Steps to Reproduce

Here's some simple code to reproduce the issue:

XAML

            <Picker x:Name="BirdPicker" Title="Pick a bird" />

            <Button x:Name="AddBird" Text="Add a bird"
                Margin="0,0,0,20" SemanticProperties.Hint="Adds a bird"
                Clicked="AddBird_Clicked"/>

            <Label x:Name="Birds"
                    Padding="10" MinimumWidthRequest="150"
                    TextColor="White" BackgroundColor="DarkBlue" 
                    SemanticProperties.Description="Shows the added birds" />

C#

	public MainPage()
	{
		InitializeComponent();

		BirdPicker.ItemsSource = new List<string> {
			"Duck",
			"Pigeon",
			"Penguin",
			"Ostrich",
			"Owl"
		};
	}

	private void AddBird_Clicked(object sender, EventArgs e)
	{
		if (!String.IsNullOrEmpty(Birds.Text))
		{
			Birds.Text = Birds.Text + Environment.NewLine;
		}
		Birds.Text += BirdPicker.SelectedItem;
	}

Link to public reproduction project repository

https://github.com/andrewstellman/reproduce-maui-picker-issue/

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-pickerPickerplatform/macosmacOS / Mac Catalystpotential-regressionThis issue described a possible regression on a currently supported version., verification pendings/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions