PagerTabStripView icon indicating copy to clipboard operation
PagerTabStripView copied to clipboard

Pager causes app crash in iOS 16.4 due to a division by zero in PagerSettings.recalculateTransition()

Open mcaciule opened this issue 2 years ago • 4 comments

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)

mcaciule avatar Mar 22 '23 22:03 mcaciule

I also reproduce on iPhone 14 sim

aehlke avatar Apr 06 '23 23:04 aehlke

Reproduced on iPhone 14 pro, iOS 16.2

stephenfung98 avatar May 15 '23 05:05 stephenfung98

It happens when PagerTabStripView is empty, e.g., no tabs are inside.

f1xmAn avatar Nov 22 '23 15:11 f1xmAn

I'm also able to recreate this, but there are no scenarios where I don't have any tabs.

mergesort avatar Jan 09 '24 23:01 mergesort