Skip to content
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

Scroll to top on iOS 15 devices has glitch or a behaviour different in the 'main' branch respect to '4.0.0' version for expanded items. #1564

Open
3 tasks done
shadowsheep1 opened this issue Jul 5, 2022 · 0 comments

Comments

@shadowsheep1
Copy link

shadowsheep1 commented Jul 5, 2022

New issue checklist

  • I have reviewed the README and documentation
  • I have searched existing issues and this is not a duplicate
  • I have attempted to reproduce the issue and include an example project.

General information

  • IGListKit version: main branch
  • iOS version(s): iOS 15
  • CocoaPods: 1.11.3
  • Xcode version: 13.4.1
  • Devices/Simulators affected: iOS 15 powered devices/simulators
  • Reproducible in the demo project? (Yes/No): YES
  • Related issues: none

Debug information

As a workaround you could disable batchContext.reload(self) on iOS 15, loosing animation updates.

override func didSelectItem(at index: Int) {
    collectionContext?.performBatch(
      animated: true,
      updates: { [weak self] batchContext in
        guard let self = self else { return }
        self.expanded.toggle()
        if #available(iOS 15, *) {
          // do nothing
        } else {
          batchContext.reload(self)
        }
      },
      completion: { [weak self] succeded in
        guard let self = self else { return }
        self.collectionContext?.scroll(
            to: self,
            at: index,
            scrollPosition: .top,
            animated: true
        )
      })
  }

Marslink_Final.zip
Screen Recording 2022-07-05 at 09.05.33.zip

different_behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant