fermoya / SwiftUIPager

Native Pager in SwiftUI
MIT License
1.3k stars 172 forks source link

[BUG] Pager scrolls in the opposite direction in RLT languages #334

Open larryonoff opened 10 months ago

larryonoff commented 10 months ago

Describe the bug Pager scrolls in the opposite direction in RLT languages. User tries to scroll from top-to-bottom, but pager scrolls from bottom-to-top.

To Reproduce

    GeometryReader { geometry in
      let itemSize = CGSize(
        width: geometry.size.width,
        height: geometry.size.height - 63
      )

      if !itemSize.isEmpty {
        Pager(
          page: page,
          data: viewStore.state,
          id: \.self,
          content: { element in
            ...
          }
        )
        .alignment(.start)
        .itemSpacing(.itemSpacing)
        .preferredItemSize(itemSize, alignment: .start)
        .sensitivity(.high)
        .vertical()
        .templatePreviewSize(itemSize)
     }
  }

Expected behavior Pager scrolls in the same direction user scrolls.

Environment: