Why Not Every Part Of View Is Clickable In NavigationLink

My navigation link looks like this

struct ContentView: View {
  var body: some View {
    NavigationView {
      GeometryReader { geometryProxy in
        NavigationLink {
            EmptyView() // Any view
        }
        label: {
          TestView(geometryProxy: geometryProxy)
              .buttonStyle(.plain)
               .padding(.leading, 8)
        }
        .buttonStyle(.plain)
        .padding(.leading, 0)
      }
    }
  }
}

And my test view looks like this

struct TestView: View {
var geometryProxy: GeometryProxy
   
  var body: some View {
    HStack {
      Text("Some text here extra space on right")
        .frame(maxWidth: geometryProxy.size.width * 0.85, alignment: .leading)
      HStack {
        Text("9.4")
          .lineLimit(2)
          .padding(8)
      }
      .frame(maxWidth: geometryProxy.size.width * 0.15)
      .padding([.top, .bottom], 4)
    }
  }
}

Because there is some gap between the text "Some text here extra space on right" and "9.4", when that area gets tapped nothing happens. NavigationLink will only work when any text is tapped. Why is that?

What is lacking here that will make any view in the TestView cllickable, including empty space.

Answered by Claude31 in 733205022

Your code does not compile.

On the call of testView: Missing argument for parameter 'geometryProxy' in call

Could you show the actual and complete code ?

Accepted Answer
Why Not Every Part Of View Is Clickable In NavigationLink
 
 
Q