-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix CollectionView scroll behaviour when section is empty #808
Conversation
1 Travis check failed, looks like the parameter for the device is wrong : "Unsupported device specifier option.". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me 👍 💯
cc @rnystrom
@gmoledina awesome! Do you mind adding a unit test to make sure this doesn't regress in the future? |
9f9da15
to
40893dc
Compare
@gmoledina updated the pull request - view changes |
@jessesquires @rnystrom Sure thing ! I've added some simple tests. While adding the tests, I noticed 2 things : 1- calling 2- if we choose For the 1st point, I would ignore it as it's the default UICVFlowLayout behaviour. |
@gmoledina updated the pull request - view changes |
@rnystrom has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
1 similar comment
@rnystrom has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@rnystrom Let me know if you need more details regarding the 2 points I mentioned in my last comment ! I could write failing tests in a separate branch for point 2. |
@gmoledina good points! Agree let's skip 1 b/c that's flow layout's behavior. I don't want to work around it too much as some people could expect it or it might change. Let's whip up another issue for 2 though and include some failing unit tests in the issue if you have them on hand. |
@gmoledina quick heads up that the |
@gmoledina checking in on this? |
@gmoledina updated the pull request - view changes - changes since last import |
6595ad7
to
c71868a
Compare
@gmoledina updated the pull request - view changes - changes since last import |
@rnystrom Indeed, tests were failing on my side as well - weird. The reason was that |
Hell ya! Going to land this when I'm back from a vacation early next week. That way if something breaks, nobody has to scramble to fix while I'm out. Pumped for this! |
@rnystrom sounds good - enjoy your vacation ! |
@gmoledina updated the pull request - view changes - changes since last import |
@rnystrom has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
FYI this caused a regression internally b/c calling |
Changes in this pull request
Issue fixed: When a section is empty (0 cells) but has a header/footer supplementary views, calling
scrollToObject:supplementaryKinds:scrollDirection:scrollPosition:animated
wouldn't do anything as the method implementation has an early return if the section doesn't have any cells:As the section does have supplementary views and is displayed on screen, there's no reason not to scroll to it. This minor change fixes this detail.
Checklist
Change in internal implementation of one method - all current tests pass. No tests added.
CHANGELOG.md
for any breaking changes, enhancements, or bug fixes.