maui icon indicating copy to clipboard operation
maui copied to clipboard

Picker() on Mac Catalyst does not display dialog with items

Open arseniigorkin opened this issue 1 year ago • 6 comments

Description

Picker() on the modal page does not show a dialog for picking elements in Mac Catalyst. MAUI on .Net 8.

Steps to Reproduce

Create a page (ContentPage) and open it by OpenModalAsync(); On the page place a Picker() with simple string items, set in the page (no binding). Click on it. The dialog to pick the element does not appear. Binding to ViewModel does not change the situation.

Link to public reproduction project repository

https://github.com/arseniigorkin/MAUIPickerIssue

Version with bug

8.0.7, 8.0.20

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

No response

arseniigorkin avatar Mar 26 '24 21:03 arseniigorkin

I believe that's because the Picker on Mac Catalyst opens a modal with the options to select. AFAIK You can't have multiple modals open at the same time in Catalyst, so unless the control is reimplemented to not require a modal, you couldn't use it from within a modal view.

drasticactions avatar Mar 27 '24 07:03 drasticactions

I believe that's because the Picker on Mac Catalyst opens a modal with the options to select. AFAIK You can't have multiple modals open at the same time in Catalyst, so unless the control is reimplemented to not require a modal, you couldn't use it from within a modal view.

Actually, the Alert works just fine in the same conditions and it was an issue some time ago that alert could be displayed in the modal page on Mac but then it was fixed (you can check, it works). Thus the problem relates only to Picker and it is a subject to fix, as I believe. Our production stuck with this issue now.

arseniigorkin avatar Mar 27 '24 12:03 arseniigorkin

Hi @arseniigorkin. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Hi! I have just posted a working demo for you. As you can see it does not work on Mac Catalyst only. I hope it helps.

arseniigorkin avatar Mar 28 '24 00:03 arseniigorkin

Verified this issue with Visual Studio for mac 17.6.10(build428)(8.0.14/8.0.3). Can repro on Maccatalyst platform with sample project, and android platform works fine

kevinxufei avatar Mar 28 '24 05:03 kevinxufei

I believe that's because the Picker on Mac Catalyst opens a modal with the options to select. AFAIK You can't have multiple modals open at the same time in Catalyst, so unless the control is reimplemented to not require a modal, you couldn't use it from within a modal view.

Actually, the Alert works just fine in the same conditions and it was an issue some time ago that alert could be displayed in the modal page on Mac but then it was fixed (you can check, it works). Thus the problem relates only to Picker and it is a subject to fix, as I believe. Our production stuck with this issue now.

I never said it shouldn't be fixed (to be clear, I don't work on MAUI, I'm just a member in .NET trying to help). That's all.

drasticactions avatar Mar 29 '24 07:03 drasticactions

On 8.0.20 still not working

arseniigorkin avatar Apr 13 '24 18:04 arseniigorkin

Hey all! It is more than a month this issue is open. Is there any update on it? Any workaround? Thanks!

arseniigorkin avatar Apr 26 '24 18:04 arseniigorkin

I believe that's because the Picker on Mac Catalyst opens a modal with the options to select. AFAIK You can't have multiple modals open at the same time in Catalyst, so unless the control is reimplemented to not require a modal, you couldn't use it from within a modal view.

Actually, the Alert works just fine in the same conditions and it was an issue some time ago that alert could be displayed in the modal page on Mac but then it was fixed (you can check, it works). Thus the problem relates only to Picker and it is a subject to fix, as I believe. Our production stuck with this issue now.

I never said it shouldn't be fixed (to be clear, I don't work on MAUI, I'm just a member in .NET trying to help). That's all.

No probs. How did you want to help? Do you know a workaround or you could help to fix it? BTW: I did not tell you said it shouldn't be fixed :) Just added that nevertheless it should be, as I believe, so, no worry. I think it was misunderstanding.

arseniigorkin avatar Apr 26 '24 18:04 arseniigorkin

This is also posing an issue in my migration to using MacCatalyst. It seems kinda important that a core control does not work in an extremely common use case.

daltzctr avatar May 08 '24 18:05 daltzctr

Hey! Is there update on this one? Thanks!

arseniigorkin avatar Jul 18 '24 20:07 arseniigorkin

This issue is a complicated one, as this is fundamentally an iOS/MacCatalyst issue. Pickers are modal and you can only have one modal displayed at one time. There are controls available via MacCatalyst, but MAUI would have to create a new XPlat picker/impl for it.

I doubt this is getting fixed for .NET 9.

daltzctr avatar Jul 18 '24 21:07 daltzctr

This issue is a complicated one, as this is fundamentally an iOS/MacCatalyst issue. Pickers are modal and you can only have one modal displayed at one time. There are controls available via MacCatalyst, but MAUI would have to create a new XPlat picker/impl for it.

I doubt this is getting fixed for .NET 9.

Thank you for your reply! Well, then, we will have to use modals instead of pickers, as modals over modals work well. The only thing - it takes more time to set it up and some extra code, but this is the only solution I found for the issue.

I hope next round, say, on .Net 10 we will see this working well :)

arseniigorkin avatar Jul 18 '24 23:07 arseniigorkin