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

Make comments start at bottom of container #311

Merged
merged 3 commits into from
Aug 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/page/HomePage/Report/ReportHistoryView.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ class ReportHistoryView extends React.Component {
onContentSizeChange={this.scrollToListBottom}
bounces={false}
contentContainerStyle={{
paddingVertical: 16
flexGrow: 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these can be referenced like our other styles, so how about moving these into the stylesheet?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would work. I think paddingVertical has to be referenced as a contentContainerStyle

This is a little over my head, but can you check this doc and let me know if we can take the styles.whatever approach for the other rules? https://reactnative.dev/docs/scrollview

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I looked at that, and it should work to use our normal styles.whatever 👍

The paddingVertical is fine to put into styles.whatever and looks like it will work for anything. The docs say it's a shorthand for specifying top and bottom padding: https://reactnative.dev/docs/layout-props#paddingvertical

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm so I'm running into this when trying to apply a styles.whatever to the ScrollView container:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nvm - contentContainerStyle={[styles.chatContentScrollView]} seems to do the trick!

justifyContent: 'flex-end',
paddingVertical: 16,
}}
>
{_.chain(this.props.reportHistory).sortBy('sequenceNumber').map((item, index) => (
Expand Down