0

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.

5
  • Please see How to Ask and include a minimal reproducible example Commented Nov 22, 2023 at 18:18
  • I'm not able to reproduce this on an iPhone 14 simulator running iOS 17.0. When an option is selected, the text changes instantaneously, even with animations slowed. Which iOS version are you testing with? Commented Nov 22, 2023 at 18:58
  • iOS17 with an iPhone 15 Pro. It does it on the simulator and on my iPhone when I test it. @BenzyNeez Commented Nov 22, 2023 at 19:17
  • I did another instance of a Picker in another view I’m working on, same situation different length strings and it did the same thing. Exact same setup as what I have here except the strings were different. @BenzyNeez Commented Nov 22, 2023 at 19:29
  • Also unable to reproduce the issue with iPhone 15 Pro, iOS17 (Simulator). Is it possible the problem is the (missing) surrounding code? Commented Nov 23, 2023 at 12:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.