Fix content inset issues with scroll indicators and keyboard insets #103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue with the scroll indicator insets not being set to match the content insets, which is almost always the correct behavior. In the first GIF you can see the scroll indicator disappears behind the keyboard, while the in the second gif it matches the content size.
This PR also fixes an issue when calculating the inset to add to adjust for a visible keyboard. I chose to subtract the bottom content inset from the calculation, as the collection view keeps the safe area inset in addition to insets you set. Another option might be to disable safe area inset adjustments entirely, but then we would lose the automatic adjustment when in most cases we want it. In the first GIF you can see the gap between the collection view content and the keyboard. In the second, there's no gap. Both have the correct safe area when the keyboard is not visible.