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

[TableDirector/CollectionDirector] elementAt gives back the wrong element #15

Closed
geraldeersteling opened this issue May 22, 2019 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@geraldeersteling
Copy link
Contributor

geraldeersteling commented May 22, 2019

I've discovered a but in the function elementAt (L:267) in the TableDirector.

The function returns the same element because the return value uses the wrong index to search the elements array. Here is the current line which returns the element:

return sections[indexPath.section].elements[indexPath.section]

I think the index in the elements array should be indexPath.row.

@geraldeersteling
Copy link
Contributor Author

geraldeersteling commented May 22, 2019

I realised I could also fork your repo and try to fix it myself; as such, I made a MR

EDIT:
Also fixed it in CollectionDirector

@malcommac malcommac changed the title [TableDirector] elementAt gives back the wrong element [TableDirector/CollectionDirector] elementAt gives back the wrong element May 23, 2019
@malcommac malcommac self-assigned this May 23, 2019
@malcommac malcommac added the bug Something isn't working label May 23, 2019
@malcommac malcommac added this to the 1.0.4 milestone May 23, 2019
@malcommac
Copy link
Owner

Fixes merged! thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants