DatePicker time input cutoff

Originator:dfeinzimer
Number:rdar://FB13699023 Date Originated:03/26/2024
Status:Open Resolved:
Product:SwiftUI Product Version:
Classification: Reproducible:
 
A conditionally shown `DatePicker` with `.datePickerStyle(.graphical)` has the time input cutoff until a new selection is made.

Repro steps:
1) Tap “Select a date” to show the conditionally hidden DatePicker.
2) What happens: The time input is cutoff. What I expect: The time input is not cutoff.
3) Choose a new date.
4) The time input is shown as expected.

See code snippet below

The device recording is from a 9th gen iPad running 17.4.1
The simulator recording is an iPhone 15 Pro Max running 17.4
I’m using Xcode Version 15.3 (15E204a)

```
struct ContentView: View {
    @State private var selection = Date.now
    @State private var isOpen = false
    var body: some View {
        Button("Select a date") {
            isOpen.toggle()
        }
        if isOpen {
            DatePicker("Date Picker", selection: $selection)
                .datePickerStyle(.graphical)
        }
    }
}
```

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!