SwiftUI Document App with UTType.directory

I'm struggling to create a simple document app on macOS that can open a directory (and display content found there).

I created a new project in Xcode 15 using the "Document App" template and then just changed the readableContentTypes var like this:

struct DocumentDemoDocument: FileDocument {
    //...

    static var readableContentTypes: [UTType] { [.directory, .folder] }```

    //...
}

But, when I run that app and choose File->Open..., the Open button is still grayed out when a directory is selected. What did I miss here?

I'm having the same issue. This effectively prevents me from creating my app with SwiftUI, as opening directories is a central part of it.

SwiftUI Document App with UTType.directory
 
 
Q