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

On vertical scroll with sections, unexpected behaviour. Cells appear in front of others #64

Open
Johnathan-Aretos opened this issue Dec 25, 2020 · 0 comments

Comments

@Johnathan-Aretos
Copy link

When sections are being used it breaks the logic

attributes.zIndex = attributes.indexPath.row -> PageAttributeAnimator.swift

Given a zIndex will determine depth when using indexPath values e.g [0,1], sections, row respectively. We run into issues when the section resets.

I don't know of a cleaner solution, but what I've been using at the moment is

var section = attributes.indexPath.section
var numItems = 0

while section >= 0 {
    numItems += collectionView.numberOfItems(inSection: section)
    section -= 1

attributes.zIndex = attributes.indexPath.row + numItems

Which seems to be doing the trick, my run into performance issues when using larger data sets. A more elegant solution will be to use visible cells and work out within the two cells an appropriate zIndex.

Happy for suggestions to make a PR

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