Skip to content

Commit

Permalink
Fix crash when deleting/filtering items
Browse files Browse the repository at this point in the history
  • Loading branch information
fermoya committed May 20, 2022
1 parent 9153fc1 commit 669d20f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Sources/SwiftUIPager/Page.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ public class Page: ObservableObject {
}

/// Total number of pages
var totalPages: Int = Int.max
var totalPages: Int = Int.max {
didSet {
// reset in case there's a deletion
self.index = index
}
}

#if !os(tvOS)

Expand Down
6 changes: 4 additions & 2 deletions release_description.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### Features
- #254 New modifier `dragForwardOnly`
- #265 Support for _watchOS_ `digitalCrownRotation`
- #280 Support RTL languages

### Fixes
- #279 Crash when deleting/filtering items

0 comments on commit 669d20f

Please sign in to comment.