File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
druid-shell/src/platform/mac Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ pub(crate) fn get_file_dialog_path(
3939 FileDialogType :: Save => msg_send ! [ class!( NSSavePanel ) , savePanel] ,
4040 } ;
4141
42+ // Directories with extensions need to be treated as directories.
43+ // File packages are a macOS concept and don't translate in a cross-platform way.
44+ let ( ) = msg_send ! [ panel, setTreatsFilePackagesAsDirectories: YES ] ;
45+
4246 // Set open dialog specific options
4347 // NSOpenPanel inherits from NSSavePanel and thus has more options.
4448 let mut set_type_filter = true ;
@@ -49,7 +53,8 @@ pub(crate) fn get_file_dialog_path(
4953 // because other platforms like Windows have no support for it,
5054 // and expecting it to work will lead to buggy cross-platform behavior.
5155 let ( ) = msg_send ! [ panel, setCanChooseFiles: NO ] ;
52- // Because we're choosing only directories, file filters don't make sense.
56+ // Because we're choosing only directories, file filters need to be disabled.
57+ // Otherwise macOS will still allow selecting those files which match the filter.
5358 set_type_filter = false ;
5459 }
5560 if options. multi_selection {
You can’t perform that action at this time.
0 commit comments