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

/connect rerender chat #1359

Merged
merged 4 commits into from Dec 18, 2018
Merged

Conversation

mariocsee
Copy link
Contributor

@mariocsee mariocsee commented Dec 18, 2018

What type of PR is this? (check all applicable)

  • Bug Fix

Description

When in 'dev.to/connect', clicking the paper airplane rerenders chat and triggers the componentDidUpdate() function in chat.jsx, which calls scrollToBottom() from utils.js.

The error occurs because when scrollToBottom() is called, the element it needs document.getElementById('messagelist') has not been rendered yet thus not being able to find the scrollHeight attribute. To avoid this, I added an if statement in componentDidUpdate() that checks that document.getElementById('messagelist') is found before letting scrollToBottom() be called.

Related Tickets & Documents

Resolves #1357

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

See screenshots in #1357

Added to documentation?

  • no documentation needed

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Dec 18, 2018
@mariocsee mariocsee changed the title /connect rerender chat [WIP] /connect rerender chat Dec 18, 2018
@pr-triage pr-triage bot removed the PR: unreviewed bot applied label for PR's with no review label Dec 18, 2018
@mariocsee mariocsee changed the title [WIP] /connect rerender chat /connect rerender chat Dec 18, 2018
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Dec 18, 2018
@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Dec 18, 2018
@benhalpern benhalpern merged commit 60d38ef into forem:master Dec 18, 2018
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Dec 18, 2018
@mariocsee mariocsee deleted the connect-rerender-chat branch December 18, 2018 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants