PLT-5077: Fix floating date on mobile view. (#5061)

This commit is contained in:
George Goldberg
2017-01-18 20:15:43 +00:00
committed by Corey Hulen
parent 99cf08ac38
commit b6cafd5981
2 changed files with 6 additions and 2 deletions

View File

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

View File

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