title: SwiftUI: Menu inside list cell with onTapGesture triggers gesture
body: <p>I have a SwiftUI <code>List</code> on iOS14.3 (Xcode12.3) and inside it's cells I want to have a <code>Menu</code> popup up when the user is tapping on a button. Additionally these cells have an <code>onTapGesture</code> and the problem is that this gesture is also triggered when the menu button is pressed.</p>
  <p><strong>Example:</strong></p>
  <pre><code>List {
      HStack {
          Text(&quot;Cell content&quot;)
          Spacer()
          // Triggers also onTapGesture of cell
          Menu(content: {
              Button(action: { }) {
                  Text(&quot;Menu Item 1&quot;)
                  Image(systemName: &quot;command&quot;)
              }
              Button(action: { }) {
                  Text(&quot;Menu Item 2&quot;)
                  Image(systemName: &quot;option&quot;)
              }
              Button(action: { }) {
                  Text(&quot;Menu Item 3&quot;)
                  Image(systemName: &quot;shift&quot;)
              }
          }) {
              Image(systemName: &quot;ellipsis&quot;)
                  .imageScale(.large)
                  .padding()
          }
      }
      .background(Color(.systemBackground))
      .onTapGesture {
          print(&quot;Cell tapped&quot;)
      }
  }
  </code></pre>
  <p>If you tap on the ellipsis image, the menu opens but also <code>&quot;Cell tapped&quot;</code> will be printed to the console. This is a problem for me, because in my real world example I am collapsing the cell within the tap gesture and of course I don't want that to happen when the user presses the menu button.</p>
  <p>I found out, that when I long press on the button the gesture won't be triggered. But this is not acceptable UX in my opinion, took me a while to find that out for my self.</p>
  <p>I also noticed, when I replace the <code>Menu</code> with a regular <code>Button</code>, then the cells gesture is not triggered while pressing (only with <code>BorderlessButtonStyle</code> or <code>PlainButtonStyle</code>, otherwise he is not active at all). But I don't know how to open a Menu from it's action.</p>
  <pre><code>List {
      HStack {
          Text(&quot;Cell content&quot;)
          Spacer()
          // Does not trigger cells onTapGesture, but how to open Menu from action?
          Button(action: { print(&quot;Button tapped&quot;) }) {
              Image(systemName: &quot;ellipsis&quot;)
                  .imageScale(.large)
                  .padding()
          }
          .buttonStyle(BorderlessButtonStyle())
      }
      .background(Color(.systemBackground))
      .onTapGesture {
          print(&quot;Cell tapped&quot;)
      }
  }
  </code></pre>