Responsive width of chat ui

  angular, css, html, javascript

im trying to create a chat plugin like this

enter image description here

how to make the chat messages div responsive?

and also i want to make this auto scroll to newer chat, currently im using this

 #scrollMe [scrollTop]="scrollMe.scrollHeight"

and the result like this, it doesn’t immediately scroll to newer chat, it always waiting a couples of seconds

enter image description here

Source: Ask Javascript Questions