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

Make comments start at bottom of container #311

merged 3 commits into from
Aug 28, 2020

Conversation

shawnborton
Copy link
Contributor

@tgolen @marcaaron will you please test and review? This makes comments start at the bottom of the scroll view container, so when you start a new chat with someone, everything is bottom-docked until it eventually scrolls.

image

Tests:

  1. On a blank chat, send a message and make sure the message is docked at the bottom of the screen
  2. Add more messages and make sure the bottom-docking is still happening
  3. With a chat that has many many messages, make sure the container scrolls normally

@shawnborton shawnborton self-assigned this Aug 27, 2020
Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

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

OMG You figured this out! It was driving me nuts

@@ -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!

@shawnborton
Copy link
Contributor Author

Updated!

@shawnborton
Copy link
Contributor Author

Ah, I see conflicts now... one moment.

@tgolen tgolen merged commit 7464f6e into master Aug 28, 2020
@tgolen tgolen deleted the shawn-flexEnd branch August 28, 2020 17:17
@perunt perunt mentioned this pull request Dec 20, 2023
50 tasks
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

Successfully merging this pull request may close these issues.

2 participants