Last active
July 27, 2020 16:10
-
-
Save spg/748213665c644d9ad951bff117c534e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class LongMessage extends React.Component { | |
componentDidMount() { | |
const newMessagesIndicator = document.getElementsByClassName('bpw-new-messages-indicator')[0] | |
// If the "New Messages" div is present, we should not auto-scroll | |
if (!newMessagesIndicator) { | |
const messagesList = document.getElementsByClassName('bpw-msg-list')[0] | |
messagesList.scrollTop = messagesList.scrollHeight | |
} | |
} | |
render() { | |
return ( | |
<div> | |
{this.props.children} line 1<br /> | |
line 1<br /> | |
line 2<br /> | |
line 3<br /> | |
line 4<br /> | |
line 5<br /> | |
line 6<br /> | |
line 7<br /> | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment