forked from shadowfacts/Tusker
Fix animating poll configuration button size change when selected option
changes
This commit is contained in:
parent
57cb0614a9
commit
2b50609e5c
|
@ -59,19 +59,21 @@ struct ComposePollView: View {
|
|||
}
|
||||
|
||||
HStack {
|
||||
// use .animation(nil) on the binding and .frame(maxWidth: .infinity) on labels so frame doesn't have a size change animation when the text changes
|
||||
Picker(selection: $poll.multiple.animation(nil), label: Text(poll.multiple ? "Allow multiple choices" : "Single choice").frame(maxWidth: .infinity)) {
|
||||
// use .animation(nil) on pickers so frame doesn't have a size change animation when the text changes
|
||||
Picker(selection: $poll.multiple, label: Text(poll.multiple ? "Allow multiple choices" : "Single choice")) {
|
||||
Text("Allow multiple choices").tag(true)
|
||||
Text("Single choice").tag(false)
|
||||
}
|
||||
.animation(nil)
|
||||
.pickerStyle(MenuPickerStyle())
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
Picker(selection: $duration.animation(nil), label: Text(verbatim: ComposePollView.formatter.string(from: duration.timeInterval)!).frame(maxWidth: .infinity)) {
|
||||
Picker(selection: $duration, label: Text(verbatim: ComposePollView.formatter.string(from: duration.timeInterval)!)) {
|
||||
ForEach(Duration.allCases, id: \.self) { (duration) in
|
||||
Text(ComposePollView.formatter.string(from: duration.timeInterval)!).tag(duration)
|
||||
}
|
||||
}
|
||||
.animation(nil)
|
||||
.pickerStyle(MenuPickerStyle())
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue