nathantannar4 / Transmission

Bridges UIKit presentation APIs to a SwiftUI API so you can use presentation controllers, interactive transitions and more.
BSD 2-Clause "Simplified" License
419 stars 15 forks source link

DatePicker changes style unexpectadly inside DestinationLink #35

Closed PhilipDukhov closed 2 months ago

PhilipDukhov commented 9 months ago

Initially it renders day as "24/01/2024" when view appears, and when push transition finished it switches to "24 Jan 2024". With NavigationLink there's no such issue

struct ContentView: View {
    var body: some View {
        NavigationView {
            DestinationLink {
                DatePicker("picker", selection: .constant(ISO8601DateFormatter().date(from: "2024-01-24T16:00:00Z")!))
            } label: {
                Text("push")
            }
        }
    }
}

https://github.com/nathantannar4/Transmission/assets/6103621/193a7cd5-cb69-4ffc-9738-8f582510265b

nathantannar4 commented 9 months ago

You're seeing this on version >= 1.1.3?

PhilipDukhov commented 9 months ago

The funny thing is that I can't see it today, but when I switched time to 19 Jan(date this issue has been created) in my system settings, I was able to reproduce it again, on 1.1.4

nathantannar4 commented 2 months ago

I think this is a bug with DatePicker. I've seen some other reports of the format changing. In this case, it seems like the assigned format isn't set until the view is pushed on screen.

https://stackoverflow.com/a/76581476

Will keep trying to find workarounds.

nathantannar4 commented 2 months ago

Fixed in 1.4.3!

PhilipDukhov commented 2 months ago

This is super cool, thank you!