Skip to content

Commit

Permalink
fix disableSwipe stop working after last version
Browse files Browse the repository at this point in the history
  • Loading branch information
X901 committed Jan 4, 2024
1 parent ea1275c commit 63110b5
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Sources/FXDatePicker/Views/FXDatePickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public struct FXDatePickerView: View {
@Environment(\.layoutDirection) private var layoutDirection

private var hideMarkers: Bool = false
@State private var disableSwipe: Bool = false
private var disableSwipe: Bool = false
private var hideDatePicker: Bool = false

@State private var dateRange: [Date] = []
Expand Down Expand Up @@ -121,15 +121,8 @@ public struct FXDatePickerView: View {

openShowSelectedMonths ? SelectMonthPickerView(selectedDate: $selectedDate, calendar: calendar, calenderType: calenderType)
.onChange(of: selectedDate, perform: { value in
disableSwipe = true
displayedMonth = value
setupCurrentDate()

DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
disableSwipe = false
})


})

: nil
Expand Down Expand Up @@ -162,7 +155,7 @@ public extension FXDatePickerView {
}

func disableSwipe(_ disable: Bool = true) -> FXDatePickerView {
let fxDatePicker = self
var fxDatePicker = self
fxDatePicker.disableSwipe = disable
return fxDatePicker
}
Expand Down

0 comments on commit 63110b5

Please sign in to comment.