A basic DocumentGroup App presents two back "<" buttons on the navigation bar.

Please has anyone found a workaround for duplicate back buttons appearing on the toolbar of a ContentView launched from a DocumentGroup?

The problem occurs with Xcode 14.0 running a basic DocumentGroup App on iOS 16.0.

To reproduce, simply build a new project using the "Document App" template. Build and run in the iOS/iPadOS simulator or on an iOS/iPadOS device.

Two back buttons appear. Only one functions. I've not found a way to eliminate the dud.

This problem has occurred throughout the Xcode 14.0 beta program.

Did you report this, because I'm having the exact same issue. Made a ticket, and nothing...

I have the same issue. Didn’t happen on iOS 15. i haven’t found a workaround so far sadly.

Ok I just accidentally found a workaround, use with caution because I haven't checked yet what exactly it does (but it removes the additional back button). Adding .toolbarRole(.automatic) to the content view fixes it (or any of those roles).

DocumentGroup(newDocument: TestDocAppDocument()) { file in
            ContentView(document: file.$document) 
                 .toolbarRole(.automatic)
}

Nice one. Thank you! It looks as if ".browser", ".automatic", ".navigationStack" each eliminate the extra (left hand) back button nicely. Choosing ".editor" is the odd-ball. I've not made sense of the documentation on this - but - for now I'll run with .automatic. Thanks again.

Great job. Had just started rewriting my app to 'fileImporter'

This bug seems to be fixed in iOS 16.2

Try this:

NavigationStack {
  // ...
}
.navigationBarHidden(true)

Don't use NavigationView, use NavigationStack

A basic DocumentGroup App presents two back "&lt;" buttons on the navigation bar.
 
 
Q