In our app, we allow the user to open files using the native NSOpenPanel API. In the open dialog, we have an accessory view to filter the set of enabled files based on file type. The first filter in the list (i.e. the default filter), is "all <appname> files", and last filter in the list is "All Files".
In macOS 10.14 and earlier, switching to the "All Files" filter successfully enabled all files, even ones not categorized as "<appname> files". However, starting with macOS 10.15, this no longer works as expected - switching to the "All Files" filter only enables files considered "<appname> files".
After investigation and debugging, we determined that setting the initial filter to "All Files" produced the expected results, giving us the following conclusion:
In 10.15, a file will only appear enabled in the dialog BOTH of the following are true:
In other words:
Even though making "All Files" the initial filter solves the problem, it is a last resort fix due to various reasons, and isn't ideal for us.
Is there a workaround?
In macOS 10.14 and earlier, switching to the "All Files" filter successfully enabled all files, even ones not categorized as "<appname> files". However, starting with macOS 10.15, this no longer works as expected - switching to the "All Files" filter only enables files considered "<appname> files".
After investigation and debugging, we determined that setting the initial filter to "All Files" produced the expected results, giving us the following conclusion:
In 10.15, a file will only appear enabled in the dialog BOTH of the following are true:
shouldEnableURL returns true for the file
The file belongs to the set of valid items in the initial filter
In other words:
In 10.14, shouldEnableURL was the only thing that determined whether or not a file should appear enabled
In 10.15, an additional factor is now involved (checking against the initial filter set)
Even though making "All Files" the initial filter solves the problem, it is a last resort fix due to various reasons, and isn't ideal for us.
Is there a workaround?