Skip to content

Fixed Picker Items are not Displaying on macOS platform #27535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 7, 2025

Conversation

NanthiniMahalingam
Copy link
Contributor

@NanthiniMahalingam NanthiniMahalingam commented Feb 3, 2025

Issue Details

  • Picker view items are not displayed when setting the title on the picker control.

Root Cause

  • The picker view does not appear when passing the virtual view title parameter while creating the UIAlertController title on the Mac Catalyst platform.

Description of Change

  • The UIPickerView items are displayed in the picker control instead of showing the picker's title in UIAlertController when tapping on the picker by passing an empty string to the UIAlertController title parameter.

Issues Fixed

Fixes #27474,
Fixes #15954,
Fixes #18015

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Output

macOS platform

Before After
mac_Before_27474.mov
mac_After_27474.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Feb 3, 2025
Copy link
Contributor

Hey there @NanthiniMahalingam! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@vishnumenon2684 vishnumenon2684 added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Feb 3, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@jsuarezruiz jsuarezruiz added the platform/macos macOS / Mac Catalyst label Feb 3, 2025
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@NanthiniMahalingam NanthiniMahalingam marked this pull request as ready for review February 4, 2025 11:44
@Copilot Copilot AI review requested due to automatic review settings February 4, 2025 11:44
@NanthiniMahalingam NanthiniMahalingam requested a review from a team as a code owner February 4, 2025 11:44
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/rebase

@@ -50,7 +50,7 @@ void DisplayAlert(MauiPicker uITextField)
pickerView.Model = new PickerSource(this);
pickerView?.ReloadAllComponents();

var pickerController = UIAlertController.Create(VirtualView.Title, "", UIAlertControllerStyle.ActionSheet);
var pickerController = UIAlertController.Create("", "", UIAlertControllerStyle.ActionSheet);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look like a proper fix, but a hack to get it working

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @StephaneDelcroix ,

  • On the macOS native platform, when setting the title in a UIAlertController, only the title is displayed, rather than any subview added to the UIAlertController.
  • However, when setting an empty string as the title in UIAlertController, the added subview is displayed as expected.
  • Similarly, in the .NET MAUI macOS platform, a UIAlertController displays a UIPickerView added as a subview. When setting the title as an empty string, the UIPickerView subview behaves like its native macOS.
image image

@StephaneDelcroix
Copy link
Contributor

title and logo are gone in the 'after'. is this what we want ?

@NanthiniMahalingam
Copy link
Contributor Author

NanthiniMahalingam commented Feb 14, 2025

title and logo are gone in the 'after'. is this what we want ?

Hi @StephaneDelcroix Yes, we want the picker items to be displayed without the title and logo.

@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).


[Test]
[Category(UITestCategories.Picker)]
public void ShouldDisplayPickerItemsWhenOpeningPicker()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is failing on Mac because the reference snapshot is pending. Already available in the latest build.
image
Could you commit it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is failing on Mac because the reference snapshot is pending. Already available in the latest build. image Could you commit it?

I've committed the macOS output image. Could you please verify it?

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@bhavanesh2001 bhavanesh2001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump

@PureWeen PureWeen dismissed StephaneDelcroix’s stale review August 7, 2025 21:48

review taken care of

@PureWeen PureWeen changed the base branch from main to inflight/current August 7, 2025 21:48
@PureWeen PureWeen merged commit b51d4e8 into dotnet:inflight/current Aug 7, 2025
81 checks passed
PureWeen pushed a commit that referenced this pull request Aug 8, 2025
* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Create ShouldDisplayPickerItemsWhenOpeningPicker.png

Added the output image on windows platform

* Ignore the test case on catalyst platform

* Added the test case for mac platform

* Added the macOS output image

* Added the comment line for fix.
@PureWeen PureWeen added this to the .NET 9 SR11 milestone Aug 8, 2025
github-actions bot pushed a commit that referenced this pull request Aug 11, 2025
* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Create ShouldDisplayPickerItemsWhenOpeningPicker.png

Added the output image on windows platform

* Ignore the test case on catalyst platform

* Added the test case for mac platform

* Added the macOS output image

* Added the comment line for fix.
github-actions bot pushed a commit that referenced this pull request Aug 15, 2025
* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Create ShouldDisplayPickerItemsWhenOpeningPicker.png

Added the output image on windows platform

* Ignore the test case on catalyst platform

* Added the test case for mac platform

* Added the macOS output image

* Added the comment line for fix.
github-actions bot pushed a commit that referenced this pull request Aug 15, 2025
* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Create ShouldDisplayPickerItemsWhenOpeningPicker.png

Added the output image on windows platform

* Ignore the test case on catalyst platform

* Added the test case for mac platform

* Added the macOS output image

* Added the comment line for fix.
github-actions bot pushed a commit that referenced this pull request Aug 19, 2025
* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Create ShouldDisplayPickerItemsWhenOpeningPicker.png

Added the output image on windows platform

* Ignore the test case on catalyst platform

* Added the test case for mac platform

* Added the macOS output image

* Added the comment line for fix.
github-actions bot pushed a commit that referenced this pull request Aug 22, 2025
* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Fixed the picker view items source does not display on mac platform

* Added the test case

* Added the output images.

* Create ShouldDisplayPickerItemsWhenOpeningPicker.png

Added the output image on windows platform

* Ignore the test case on catalyst platform

* Added the test case for mac platform

* Added the macOS output image

* Added the comment line for fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-picker Picker community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/macos macOS / Mac Catalyst
Projects
None yet
6 participants