SwiftUI ColorPicker causes layout glitch when used from a sheet with detents

Given a sheet with [.medium] detents, that contains a native ColorPicker in SwiftUI:

struct SheetView: View {
    @State var color: Color = .white
    var body: some View {
        ColorPicker(
            "Color",
            selection: $color,
            supportsOpacity: false
        )
        .padding()
    }
}

struct ContentView: View {
    @State var isSheetOpen = false
    var body: some View {
        Button("Open Sheet") {
            isSheetOpen = true
        }
        .sheet(isPresented: $isSheetOpen) {
            SheetView()
                .presentationDetents([.medium])
        }
    }
}

When I tap the ColorPicker's color indicator button, it presents the color picker sheet with a layout glitch.

During the color picker presentation animation, the original sheet (SheetView) is rapidly pushed up and back down.

It is a wild guess but I think it has to do something with keyboard avoidance.

Unfortunately, this makes it impossible to use the picker in my app....

Thanks for flagging this @sckolos. Could you open a bug report, include the code snippet and post the FB number here once you do.

Bug Reporting: How and Why? has tips on creating your bug report.

Bug report: FB17115483

yes i have a similar error. whenever i click color picker (like the circle icon that's a color with a rainbow around it) it will glitch and make the menu behind jump the same way as describe it seems

SwiftUI ColorPicker causes layout glitch when used from a sheet with detents
 
 
Q