Repository navigation
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
A Picker view that has been added to a Popup doesn't respond to any user interaction on MacOS. Clicking on the picker does nothing, regardless of how the picker's ItemsSource is populated. The data source can be in the code-behind, bound to data in a view model, or defined in XAML. It makes no difference; the user can click on the picker and nothing will happen.
This behavior is not seen when a Picker view is added to the main page of the same project, with it's items source being defined in XAML.
Expected Behavior
When the popup is displayed, and the picker is clicked on, the picker should display a list of options for the user to select from.
Steps To Reproduce
- Open and run the solution from the reproduction repository.
- Observe that the Picker on the main page is working as expected, by clicking on it to view it's list of options to choose from.
- Click the button labeled "Show Popup" to display the popup.
- Click on the picker view on the popup, which doesn't display a list of options to choose from.
Link to public reproduction project repository
https://github.com/Rabidgoalie/ToolkitPickerPopupIssue
Environment
- .NET MAUI CommunityToolkit: 7.0.1
- OS: MacOS Sonoma 14.3.1
- .NET MAUI: 8.0 (version used by the app template)
- Test Device: Mac Mini M1
- Xcode version: 15.2
- VSCode version: 1.87.0 (Universal)
- CommunityToolkit.Mvvm version: 8.2.2
- iOS Simulator: iPhone 15
- Build configurations tested: Debug and ReleaseAnything else?
The reproduction repo has code to test the ItemsSource initialization using code-behind, XAML definition, and data-binding to a view model. This can be done by commenting/uncommenting the relevant code, and each approach was tested to ensure the Picker's ItemsSource was not null.
I encountered this issue in an app that I am working on, named CornellPad. In CornellPad, the picker has a command that is called via toolkit:EventToCommandBehavior when the picker's SelectedIndexChanged event is fired. To bypass the event-to-command calls, hoping that this might have been an issue, I created the SelectedIndexChanged event handler in the code-behind for the popup (which is found at CornellPad/Popups/CreateTopicPopup.xaml just in case someone wants to take a look, which I doubt due to the projects size). No matter how this event is handled, it is never called, which isn't a surprise since the selected index never changes. This information is being provided to illustrate that no event that I was handling was ever fired for a Picker that is added to a Popup when on MacCatalyst. No matter what, the Picker seems completely unresponsive on this platform.
I don't know what the behavior for this would be when using .NET MAUI 7 on MacCatalyst, because I was having issues getting any popups to display on that version. This was true for CornellPad as well as a separate repo that I created to issue a bug report (upgrading that sample app to .NET MAUI 8 solved the issue, so no bug report was needed). I can only get a popup to display on the main page of an app when using .NET MAUI 8.
Activity
maestro-oc commentedon May 16, 2024
We are experiencing the same issue, has anyone looked into this yet?
fit4you-bike commentedon Jul 16, 2024
Same issue:
.NET MAUI CommunityToolkit: 9.0.2
Note: no issues on iOS on iPad. Only MacOS
vhugogarcia commentedon Jul 25, 2024
Hello @fit4you-bike and @fit4you-bike, the sample project repository shared on the issue is not available anymore. I'm not sure it was marked as private access only. Could any of you share a new code sample reproducing the issue? please
Thanks in advance.
dotnet-policy-service commentedon Jul 25, 2024
Hi @Rabidgoalie. We have added the "needs reproduction" label to this issue, which indicates that we cannot take further action. This issue will be closed automatically in 5 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.
dotnet-policy-service commentedon Jul 29, 2024
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 2 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
Rabidgoalie commentedon Jul 29, 2024
This should not have been labeled "needs reproduction", as I provided a reproduction repo link. That label should be removed.
EDIT: I apologize. I didn't realize that the reproduction repo got set to private...I didn't set it to private, and I am positive that I set it to public when I posted this. I have since went into the repo and set it to public.
vhugogarcia commentedon Jul 29, 2024
Thanks @Rabidgoalie for updating the permissions on the repository sample showing the issue. We were able to reproduce the issue in our side. We are still not sure if this is an issue of the toolkit, .NET MAUI or MacCatalyst limitation. We will require more time to investigate. If you have some insights will be fantastic, please share those with us.