title: Navigation + Tabview + Sheet broken in iOS 15
body: <p>It looks like Navigation + TabView + Sheet is broken in iOS 15.</p>
  <p>When I do this:
  ContentView -&gt; DetailView -&gt; Bottom Sheet</p>
  <p>When the bottom sheet comes up, the <code>Detail</code> view is automatically popped off the stack:
  <a href="https://www.youtube.com/watch?v=gguLptAx0l4" rel="noreferrer">https://www.youtube.com/watch?v=gguLptAx0l4</a></p>
  <p>I expect the <code>Detail</code> view to stay there even when the bottom sheet appears. Does anyone have any idea on why this happens and how to fix it?</p>
  <p>Here is my sample code:</p>
  <pre><code>import Combine
  import SwiftUI
  import RealmSwift
  
  struct ContentView: View {
  
      var body: some View {
          NavigationView {
              TabView {
                  TabItemView(num: 1)
                      .tabItem {
                          Text(&quot;One&quot;)
                      }
                  TabItemView(num: 2)
                      .tabItem {
                          Text(&quot;Two&quot;)
                      }
              }
          }
      }
  }
  
  struct TabItemView: View {
  
      private let num: Int
  
      init(num: Int) {
          self.num = num
      }
  
      var body: some View {
          NavigationLink(destination: DetailView(text: &quot;Detail View \(num)&quot;)) {
              Text(&quot;Go to Detail View&quot;)
          }
      }
  }
  
  struct DetailView: View {
  
      @State private var showingSheet = false
  
      private let text: String
  
      init(text: String) {
          self.text = text
      }
  
      var body: some View {
          Button(&quot;Open Sheet&quot;) {
              showingSheet.toggle()
          }.sheet(isPresented: $showingSheet) {
              Text(&quot;Sheet Text&quot;)
          }
      }
  }
  </code></pre>
  <p>This works on iOS 14 btw</p>
  <p>UPDATE 1:</p>
  <p>Tried @Sebastian's suggestion of putting <code>NavigationView</code> inside of <code>TabView</code>. While this fixed the nav bug, it fundamentally changed the behavior (I don't want to show the tabs in <code>DetailView</code>).</p>
  <p>Also tried his suggestion of using <a href="https://github.com/siteline/SwiftUI-Introspect" rel="noreferrer">Introspect</a> to set <code>navigationController.hidesBottomBarWhenPushed = true</code> on the <code>NavigationLink</code> destination, but that didn't do anything:</p>
  <pre><code>struct ContentView: View {
      
      var body: some View {
          TabView {
              NavigationView {
                  TabItemView(num: 1)
              }.tabItem {
                  Text(&quot;One&quot;)
              }
              NavigationView {
                  TabItemView(num: 2)
              }.tabItem {
                  Text(&quot;Two&quot;)
              }
          }
      }
  }
  
  struct TabItemView: View {
      
      private let num: Int
      
      init(num: Int) {
          self.num = num
      }
      
      var body: some View {
          NavigationLink(destination: DetailView(text: &quot;Detail View \(num)&quot;).introspectNavigationController { navigationController in
              navigationController.hidesBottomBarWhenPushed = true
          }) {
              Text(&quot;Go to Detail View&quot;)
          }
      }
  }
  
  struct DetailView: View {
      
      @State private var showingSheet = false
      
      private let text: String
      
      init(text: String) {
          self.text = text
      }
      
      var body: some View {
          Button(&quot;Open Sheet&quot;) {
              showingSheet.toggle()
          }.sheet(isPresented: $showingSheet) {
              Text(&quot;Sheet Text&quot;)
          }
      }
  }
  </code></pre>