SwiftUI DocumentPicker bug: grey box inside Picker

It’s hard to describe what’s happening, see this screen record: https://youtube.com/shorts/QC9OogV7cB8?feature=share

Snippets:

UIViewControllerRepresentable:

func makeUIViewController(context: Context) -> UIDocumentPickerViewController {
    let supportedTypes: [UTType] = [UTType.item]
    return UIDocumentPickerViewController(forOpeningContentTypes: supportedTypes, asCopy: true)
}

View:

.sheet(isPresented: $viewModel.isShowingDetailView) {
     switch viewModel.selectedSubview?.subviewType{
          DocumentBrowserView()
     }
}
 

Workaround: I had this:

UITabBar.appearance().isTranslucent = false

Removing this fixes it.

SwiftUI DocumentPicker bug: grey box inside Picker
 
 
Q