DatePicker time input cutoff

FB13699023

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.

Tested on a 9th gen iPad running 17.4.1, a iPhone 15 Pro Max simulator running 17.4

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)
        }
    }
}

Post not yet marked as solved Up vote post of dav_es Down vote post of dav_es
145 views