Pager causes app crash in iOS 16.4 due to a division by zero in PagerSettings.recalculateTransition()
Describe the bug
When using pagerTabStripViewStyle on iOS 16.4, PagerTabStripView crashes every time when shown. The issue is caused by line 130 from PagerSettings:
let indexAndPercentage = -contentOffset / width
This happens only on iOS 16.4, where initially the width used here is 0. As a workaround, setting the minWidth for PagerTabStripView to a non-zero real number (e.g: 1) fixes the the issue.
Versions (please complete the following information):
- Xcode: Xcode 14.3 RC
- Device: any
- OS: 16.4 (currently beta)
I also reproduce on iPhone 14 sim
Reproduced on iPhone 14 pro, iOS 16.2
It happens when PagerTabStripView is empty, e.g., no tabs are inside.
I'm also able to recreate this, but there are no scenarios where I don't have any tabs.