Picker Animation Issue SwiftUI

77 views Asked by At

I have a Picker that's just listing a bunch of strings, but when I switch from a longer string to a shorter string, it does this weird animation because it's confining the long string to the size of the short string then expanding it to the size of the long string. I can't post the video of it, but the picture shows the frame when going from "Club" to "Greek Life" where "Greek Life" is forced to three lines. It's a noticable hiccup when testing this on my phone and I can't seem to figure out how to fix it.

Screenshot

Section{
    Picker("List Type", selection: $selectedType) {
        Text("Standard").tag("Standard")
        Divider()
        Text("Class").tag("Class")
        Text("Club").tag("Club")
        Text("Greek Life").tag("Greek Life")
        Text("Sport").tag("Sport")
        Divider()
        Text("Work").tag("Work")
        Text("Personal").tag("Personal")
        Text("Groceries").tag("Groceries")
    }
}

Also, even if I explicitly set MenuStylePicker(), it does the same thing.

I've tried putting it in a frame, adding padding, etc. The only solution I found that worked was just using a Menu, but I'd prefer a Picker given that the clickable area is the entire section, as opposed to just the text.

0

There are 0 answers