-
-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Crash when deleting last item in 2.4.0 #279
Comments
should be done in |
I encountered the same crash as sdavidliu a few hours ago, and tried to update to
Any thoughts? |
@MrConnorKenway are you deleting the last page? Can you give me more info? |
@fermoya I didn't delete the last page. Here are the partial call stack when the fatal error 'division by zero in remainder operation' occurs:
and the code that uses Pager: var body: some View {
Pager(page: page, data: galleries) {
// omitted closure
}
.preferredItemSize(Defaults.FrameSize.cardCellSize)
.interactive(opacity: 0.2).itemSpacing(20)
.loopPages().pagingPriority(.high)
.synchronize($pageIndex, $page.index)
.frame(height: Defaults.FrameSize.cardCellHeight)
} |
@fermoya I've figured out the problem. My app first inits Pager with |
Having the exact same issue sometimes on 2.4.0. I am installing right now |
Looks like I haven't got any crash so far, on both development and my users, so I think 2.5.0-beta.1 has solved the problem @fermoya |
@fermoya Having the same issue 100% of times on 2.4.0., got fixed with 2.5.0-beta.1, any plan for a release? Or an 2.4.1 hot-fix? |
Yes, will do a release next week. I'd like to take some time and review other bugs/feature requests first |
Now for us 2.5.0 crashes and 2.4.0 is not crashing - in the same scenario. |
Describe the bug
To Reproduce
Only reproducible in SwiftUIPager 2.4.0 and 2.3.3. Sample code below. Scroll to the very end and click on the "Delete" button.
Expected behavior
Safely handle crash or maybe automatically scroll to the last available index. Does not crash in 2.3.2.
Environment:
OSX: iOS 15.4
Device: Any Simulator or Device
SwiftUIPager version: 2.4.0 or 2.3.3
The text was updated successfully, but these errors were encountered: