The .NET MAUI Community Toolkit is a community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors to help make your life as a .NET MAUI developer easier
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.
- .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 Release
Anything 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.
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
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
Link to public reproduction project repository
https://github.com/Rabidgoalie/ToolkitPickerPopupIssue
Environment
Anything 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'sItemsSource
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'sSelectedIndexChanged
event is fired. To bypass the event-to-command calls, hoping that this might have been an issue, I created theSelectedIndexChanged
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.