I wish to create Menu with Picker because it’s content material. So I’m utilizing this
struct Mannequin {
var someString = "asdasd"
}
struct ContentView: View {
non-public var arrays: [String] = [
"asjkldjlasdjlasjldjklasd",
"asdasd",
"adfjklasdjlkjasdjl",
"asjkdjlasjldkjlaskdjlkasdjlkaljksdjlkasd"
]
@State var mannequin: Mannequin = .init()
var physique: some View {
Menu {
Picker("", choice: $mannequin.someString){
ForEach(arrays, id: .self) {
Textual content($0)
}
}
} label: {
Textual content(mannequin.someString)
}
}
}
Drawback is that when Picker worth adjustments to longer string, Menu label textual content have this animation like loading textual content. Can this be ommited?
I’ve tried to replace label textual content with @State, however unsuccessfully.