Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
Not fully scrolls down when a new message arrives

I'm trying to scroll down whenever a new message arrives with the following code:

    var elem = document.getElementById('chat-body');
    elem!.scrollTop = elem!.scrollHeight;

I thought that the reason could be that it might be hiding behind the form, but the scrollbar still had some space to go further down. And if I scroll down manually, it displays the full message.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try putting these two statements in setTimeout.

setTimeout(() => {
  var elem = document.getElementById('chat-body');
  elem!.scrollTop = elem!.scrollHeight;
}, 100)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!