Using Menu in tabViewBottomAccessory

I'm trying to use menu in tabViewBottomAccessory to present a menu of options and I'm finding that the tap is only registered if the text is tapped any taps outside of the text is not registered.

Is there a way to get the whole button to register?

        TabView(selection: $entryManager.currentTab) {
            Tab("Home", systemImage: "circle.hexagonpath.fill", value: .home) {
                SomeView()
}
.tabViewBottomAccessory {
                        Menu("Post Review") {
                            // MARK: Submit Other

                            Button(action: {

                            }
                            ) {
                                Label("Submit Other", systemImage: "building.2.fill")
                            }

                            Button(action: {

                            }
                            ) {
                                Label("Submit Bed", systemImage: "bed.double.fill")
                            }
                        }
}
Answered by DTS Engineer in 862054022

Hi @robevans,

I'm unable to reproduce the issue, as reported, in my own Xcode project. Because the provided example above will not build successfully due to missing types, I replaced your implementation with the following:

import SwiftUI

struct ContentView: View {
    @State private var selection = 0
    var body: some View {
        TabView(selection: $selection) {
            Tab("Home", systemImage: "circle.hexagonpath.fill", value: 0) {
                Color.red
            }
        }
        .tabViewBottomAccessory {
            Menu("Post Review") {
                Button {
                    print("Other submitted.")
                } label: {
                    Label("Submit Other", systemImage: "building.2.fill")
                }
                Button {
                    print("Bed submitted.")
                } label: {
                    Label("Submit Bed", systemImage: "bed.double.fill")
                }
            }
        }
    }
}

#Preview {
    ContentView()
}

However, if the above still does not resolve your issue, please consider adding the following view modifier to your button's content:

Button {
    print("Button tapped!")
} label: {
    SomeCustomView()
}
.contentShape(.rect)

To learn more, read the following documentation:

contentshape(_:eofill:)

https://developer.apple.com/documentation/swiftui/view/contentshape(_:eofill:)

Lastly, if updating to the most recent version of iOS 26 does not resolve your issue, please submit a report via Feedback Assistant, including a demo Xcode project, tested iOS and Xcode versions (including build numbers), and reproduction steps. Once submitted, please reply here with the Feedback ID so I can resume my investigation.

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Accepted Answer

Hi @robevans,

I'm unable to reproduce the issue, as reported, in my own Xcode project. Because the provided example above will not build successfully due to missing types, I replaced your implementation with the following:

import SwiftUI

struct ContentView: View {
    @State private var selection = 0
    var body: some View {
        TabView(selection: $selection) {
            Tab("Home", systemImage: "circle.hexagonpath.fill", value: 0) {
                Color.red
            }
        }
        .tabViewBottomAccessory {
            Menu("Post Review") {
                Button {
                    print("Other submitted.")
                } label: {
                    Label("Submit Other", systemImage: "building.2.fill")
                }
                Button {
                    print("Bed submitted.")
                } label: {
                    Label("Submit Bed", systemImage: "bed.double.fill")
                }
            }
        }
    }
}

#Preview {
    ContentView()
}

However, if the above still does not resolve your issue, please consider adding the following view modifier to your button's content:

Button {
    print("Button tapped!")
} label: {
    SomeCustomView()
}
.contentShape(.rect)

To learn more, read the following documentation:

contentshape(_:eofill:)

https://developer.apple.com/documentation/swiftui/view/contentshape(_:eofill:)

Lastly, if updating to the most recent version of iOS 26 does not resolve your issue, please submit a report via Feedback Assistant, including a demo Xcode project, tested iOS and Xcode versions (including build numbers), and reproduction steps. Once submitted, please reply here with the Feedback ID so I can resume my investigation.

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

I'll look at adding .contentShape(.rect)

Thank you!

Using Menu in tabViewBottomAccessory
 
 
Q