FilePicker on MacOS does not always return the file picked
See original GitHub issueDescription
While using FilePicker on MacOS it will regularly return null for the FileResult when a file is chosen. Code below. After a few selects it works. No exceptions or crashes. Any ideas?
Version 17.4 Preview (17.4 build 2366) Runtime .NET 6.0.9 (64-bit) Architecture: X64
[RelayCommand]
private async void SelectFile()
{
FileResult result = null;
try
{
FilePickerFileType filePickerFileType = new FilePickerFileType(
new Dictionary<DevicePlatform, IEnumerable<string>>{
{ DevicePlatform.MacCatalyst, new [] { "json" } },
{ DevicePlatform.macOS, new [] { "json"} },
{ DevicePlatform.WinUI, new [] { ".json" } }
});
PickOptions pickOptions = new PickOptions
{
PickerTitle = "Choose an engine file.",
FileTypes = filePickerFileType
};
result = await FilePicker.Default.PickAsync(pickOptions);
}
catch (Exception e)
{
Console.WriteLine(String.Format("Exception {0}", e.Message));
}
if (null != result)
{
<Button Text="Select..." Command="{Binding SelectFileCommand}"/>
Steps to Reproduce
Create a new .net Maui App Add a button. Add a relay command for the button. Use code above to select a file.
Link to public reproduction project repository
n/a
Version with bug
7.0 Release Candidate 2
Last version that worked well
Unknown/Other
Affected platforms
macOS
Affected platform versions
macOS 12, 13
Did you find any workaround?
No
Relevant log output
+[CATransaction synchronize] called within transaction
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:35 (14 by maintainers)
Top Results From Across the Web
File picker does not show all files in th…
File picker does not show all files in the folder until I navigate to another folder and then back. I've been encountering this...
Read more >FilePicker throwing an exception on mac OS with .net MAUI
PickAsync it seems to throw an PlatformNotSupportedException with this message: This platform does not support this file type.
Read more >File Picker doesn't work - Claris Community
Im using El Capitan 10.11 Beta. The field picker doesn't work properly. If i scroll down through the list of fields quickly Filemaker...
Read more >Can't select files or folders in dialog box - Ask Different
I can only press Tab, the arrow keys and Enter on my keyboard to move around, although this doesn't work correctly.
Read more >File picker sometimes doesn't work in 2.7.9
The problem is that once I have loaded a video to process, any operation involving the file picker doesn't work. So for example,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hang means in my app it does not return from the call to FilePicker.
I can’t provide a sample of this happening because it works fine in the standard Maui app. I wish I could. It only happens in my app.
I have tried my app on both Ventura and Monterey. The FilePicker hangs in both cases.