Skip to content

Commit 669d20f

Browse files
committed
Fix crash when deleting/filtering items
1 parent 9153fc1 commit 669d20f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Sources/SwiftUIPager/Page.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ public class Page: ObservableObject {
3434
}
3535

3636
/// Total number of pages
37-
var totalPages: Int = Int.max
37+
var totalPages: Int = Int.max {
38+
didSet {
39+
// reset in case there's a deletion
40+
self.index = index
41+
}
42+
}
3843

3944
#if !os(tvOS)
4045

release_description.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
### Features
2-
- #254 New modifier `dragForwardOnly`
3-
- #265 Support for _watchOS_ `digitalCrownRotation`
2+
- #280 Support RTL languages
3+
4+
### Fixes
5+
- #279 Crash when deleting/filtering items

0 commit comments

Comments
 (0)