Im trying to select one of sort in menu and sending backend . But somehow onTapGesture is not triggered. I also tried to use button but it didn't work either. Or is there any other way to trigger any of sort In menu picker.
var sortMenuPicker : some View {
HStack(alignment: .center){
Spacer()
Picker(selection: $selection, label: SortView().frame(height:UIScreen.main.bounds.height * 0.050), content: {
ForEach(sortListArray, id: \.uid, content: { item in
ForEach(item.sortList ?? [],id:\.uid) { data in
if item.id == "sort" {
Text(data.name ?? "")
.onTapGesture {
sortId = data.id
getProductList()
}
}
}
})
})
.pickerStyle(MenuPickerStyle())
