The code below is working fine in iOS 17.0.1, but in the latest update, 17.1 DatePicker does not open when we tap on it.
After several tries, I found that on the long press, around 2-3 seconds, it opens the date picker.
Any solution for this issue? How do I open only on tap?
VStack(alignment: .leading){
Text("Date".localized())
.applyFont(style: .Medium, size: 18)
.foregroundColor(Colors.grayLight)
HStack{
let lastYear = Calendar.current.date(byAdding: .year, value: -1, to: Date()) ?? Date()
if let date = checkLowerBound(){
DatePicker("",selection:$selectedDate, in: date...Date(), displayedComponents: [.date])
.frame(width: 100)
}else{
DatePicker("",selection:$selectedDate, in: lowestDate...Date(), displayedComponents: [.date])
.frame(width: 100)
}
Spacer()
}
.padding(.horizontal, 10)
}
.cardProperty()
.allowsHitTesting(!(eventTransaction != nil && eventTransaction?.by != UserDefaults.userID))
allowsHitTesting...
, then your custom modifiers (eg cardProperty), one by one to see if that makes a difference. – Phipps