Created
August 6, 2022 16:50
-
-
Save atrinh0/3df23140ba39df05692befb7153c8285 to your computer and use it in GitHub Desktop.
SwiftUI menu picker selection issue
A workaround, https://twitter.com/DanielKasaj/status/1559453531760992257
Setting the .id(UUID())
on the menu fixes the selection issue.
Menu {
Picker(selection: $selection) {
ForEach(SortOrder.allCases) {
Text($0.rawValue)
.tag($0)
}
} label: { }
} label: {
Text("Sort by")
}
.id(UUID())
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue still exists in Xcode 14 beta 5