summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-01-18 20:15:43 +0000
committerCorey Hulen <corey@hulen.com>2017-01-18 15:15:43 -0500
commitb6cafd5981d1701e84fa990aaf782d43fba12c40 (patch)
treec4974af33c3a70b7339dee1e75a4843d0fc71731
parent99cf08ac38bdee25d07f27a3d9bb5d74199d106c (diff)
downloadchat-b6cafd5981d1701e84fa990aaf782d43fba12c40.tar.gz
chat-b6cafd5981d1701e84fa990aaf782d43fba12c40.tar.bz2
chat-b6cafd5981d1701e84fa990aaf782d43fba12c40.zip
PLT-5077: Fix floating date on mobile view. (#5061)
-rw-r--r--webapp/components/post_view/components/post.jsx6
-rw-r--r--webapp/components/post_view/components/post_list.jsx2
2 files changed, 6 insertions, 2 deletions
diff --git a/webapp/components/post_view/components/post.jsx b/webapp/components/post_view/components/post.jsx
index 03075a3fb..8ba3438a0 100644
--- a/webapp/components/post_view/components/post.jsx
+++ b/webapp/components/post_view/components/post.jsx
@@ -250,7 +250,11 @@ export default class Post extends React.Component {
}
return (
- <div>
+ <div
+ ref={(div) => {
+ this.domNode = div;
+ }}
+ >
<div
id={'post_' + post.id}
className={'post ' + sameUserClass + ' ' + compactClass + ' ' + rootUser + ' ' + postType + ' ' + currentUserCss + ' ' + shouldHighlightClass + ' ' + systemMessageClass + ' ' + hideControls + ' ' + dropdownOpenedClass}
diff --git a/webapp/components/post_view/components/post_list.jsx b/webapp/components/post_view/components/post_list.jsx
index 06542d39c..e3724b688 100644
--- a/webapp/components/post_view/components/post_list.jsx
+++ b/webapp/components/post_view/components/post_list.jsx
@@ -159,7 +159,7 @@ export default class PostList extends React.Component {
const id = this.props.postList.order[i];
const element = this.refs[id];
- if (!element || element.offsetTop + element.clientHeight <= this.refs.postlist.scrollTop) {
+ if (!element || !element.domNode || element.domNode.offsetTop + element.domNode.clientHeight <= this.refs.postlist.scrollTop) {
// this post is off the top of the screen so the last one is at the top of the screen
let topPostId;