Hover effect is shown on a disabled button

Hello.

I have a scenario where a hover effect is being shown for a button that is disabled. Usually this doesn't happen but when you wrap the button in a Menu it doesn't work properly.

Here is some example code:

struct ContentView: View {
    var body: some View {
        NavigationStack {
            Color.green
                .toolbar {
                    ToolbarItem(placement: .topBarTrailing) {
                        Menu("Menu") {
                            Button("Disabled Button") {}
                                .disabled(true)
                                .hoverEffectDisabled() // This doesn't work.
                            
                            Button("Enabled Button") {}
                        }
                    }
                }
        }
    }
}

And here is what it looks like:

This looks like a SwiftUI bug. Any help is appreciated, thank you!

Could you explain precisely what you'd expect and what you get ?

When I test your code the hover disabled button does not show hovering.

However, if I comment out disabled(true)

                        Menu("Menu") {
                            Button("Disabled Button") {}
//                                .disabled(true)
                                .hoverEffectDisabled() // This doesn't work.
                            
                            Button("Enabled Button") {}
                        }

hovering is active.

This may be due to the override by the view higher in hierarchy as explained in documentation

The higher views in a view hierarchy can override the value you set on this view. In the following example, the button does not display a hover effect because the outer hoverEffectDisabled(_:) modifier overrides the inner one:

HStack {
    Button("Press") {}
        .hoverEffectDisabled(false)
}
.hoverEffectDisabled(true)
Hover effect is shown on a disabled button
 
 
Q