GraphicalDatePickerStyle breaks when used with TapGesture

Originator:alain
Number:rdar://FB9614392 Date Originated:Sep 10, 2021
Status:Open Resolved:No
Product:SwiftUI Framework Product Version:14.0+
Classification:Incorrect/Unexpected Behavior Reproducible:Yes
 
An inline date picker using GraphicalDatePickerStyle does not receive touches when a parent view has a TapGesture added to it. 

I expected that using .simultaneousGesture should allow the date picker to receive touches.

The picker will not allow changing  selection when tapping normally. The selection is only changed when using a long tap. 

This affects changing days as well as changing months using the back and forward buttons. Scrolling the months sideways works, as does tapping the name of the month to select month or year using the wheelpicker.

I attached a SwiftUI View demonstrating this problem in live preview or running on a simulator.

==========

// File attached in original request starting here

import SwiftUI

struct ContentView: View {
    @State var date: Date = Date()
    
    var body: some View {
        VStack {
            // DatePicker working normally
            DatePicker("", selection: $date, displayedComponents: [.date])
                .datePickerStyle(GraphicalDatePickerStyle())
            
            
            VStack {
                // DatePicker broken due to the simultaneousTapGesture
                DatePicker("", selection: $date, displayedComponents: [.date])
                    .datePickerStyle(GraphicalDatePickerStyle())
            }
            .simultaneousGesture(TapGesture().onEnded({ _ in
                print("Tap")
            }))
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

// File end

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!