title: Why doesn't UIVisualEffectView work in SwiftUI context menus?
body: <p>I have a relatively simple view, and I am trying to get <code>UIVisualEffectView</code> to work when used within a context menu.</p>
  <pre class="lang-swift prettyprint-override"><code>struct ContentView: View {
      var body: some View {
          ZStack(alignment: .bottomLeading) {
              Image(&quot;Flower&quot;)
                  .resizable()
                  .frame(width: 200, height: 200)
              
              VStack {
                  Text(&quot;Line 1&quot;)
                  Text(&quot;Line 2&quot;)
              }
              .frame(width: 200, height: 50)
              .background(BlurView())
          }
          .contextMenu(ContextMenu(menuItems: {
              Text(&quot;Menu Item 1&quot;)
          }))
      }
  }
  
  struct BlurView: UIViewRepresentable {
      var style: UIBlurEffect.Style = .systemMaterial
      
      func makeUIView(context: Context) -&gt; UIVisualEffectView {
          return UIVisualEffectView(effect: UIBlurEffect(style: style))
      }
      
      func updateUIView(_ uiView: UIVisualEffectView, context: Context) {
          uiView.effect = UIBlurEffect(style: style)
      }
  }
  </code></pre>
  <p>When the view loads it works great, but when the context menu is activated the whole blur just disappears.</p>
  <p><a href="https://i.stack.imgur.com/dIRSS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dIRSS.png" alt="Initial view" /></a>
  <a href="https://i.stack.imgur.com/RwBuG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RwBuG.png" alt="Context menu active" /></a></p>
  <p>Hopefully there's a workaround or I'll just have to use a completely different overlay until this is fixed.</p>