Ask A Question


You’re not receiving notifications from this thread.

From the active cable chatroom series how to I fix the size of the chatroom and scroll

John A. Cogan asked in Javascript

I have implemented the chatroom but I want the chatroom area to be fixed and for the user to be able to scroll back through the messages.
How can I add scrolling? I have tried added it to the panel the contains the chat but it is ignored? Any ideas?


I know Slack uses flexbox to do their layout. Something like this codepen:

Scrolling should be automatic if you have enough messages in the view. You can also force the scroll bar by adding overflow-y: scroll.

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 79,047+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.