title: SwiftUI onTapGuesture not working using offset inside ZStack?
body: <p>I have a Mapbox map view and a search bar and activate button (HStack) inside a ZStack and using an offset modifier to position them at the top of the screen.</p>
  <p>For some reason the offset is preventing the onTapGesture from working for the activate button, if I comment out the offset it will work but will be placed at the bottom of the screen.</p>
  <p>I tried adding the offset to each element individually inside the HStack but that did not work...</p>
  <p>How can I make the onTapGesture functionality work with offset?</p>
  <p>Thank you</p>
  <pre><code>struct MapScreen: View {
          
      var body: some View {
          NavigationView {
              ZStack(alignment: .bottom) {
                  HStack(spacing: 10) {
                      SearchBar()
                          .padding(.leading, 5)
                          .onTapGesture {
                              print(&quot;search pressed&quot;)
                             
                          }
                      ActivateButton()
                          .onTapGesture {
                              print(&quot;activate pressed&quot;)
                          }
                  }.zIndex(2)
                  .offset(y: -770)
                  MapView(locations: $locations)
                    .edgesIgnoringSafeArea([.top, .bottom])
                  BottomNavBar().zIndex(1)
                    .edgesIgnoringSafeArea(.all).offset(y: 35)
              }
              .navigationViewStyle(StackNavigationViewStyle())
              .fullScreenCover(isPresented: $presentSearchView, content: {
                  SearchView()
               })
          }
      }
  }
  
  </code></pre>