Adding contextMenu to a Button within a List prevents its normal operation
Originator: | sheeley | ||
Number: | rdar://FB7719482 | Date Originated: | |
Status: | Open | Resolved: | |
Product: | SwiftUI | Product Version: | |
Classification: | Reproducible: |
I'm trying to create a list with actions that occur both on tap/click and support a context menu. Buttons do support contextMenu when outside the list (#1), but when inside the list (#2), taps are no longer recognized, though the contextMenu still works. Is this intentional? ``` struct ContextMenu: View { @State var on = false var button: some View { Button(action: { self.on.toggle() }) { Text("Toggle") } } var body: some View { VStack { Text(on ? "on" : "off") // #1: works for both tap and context button.contextMenu { button } // #2: tap on button no longer works List { button.contextMenu { button } } } } } ```
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!