When you type a new message in a chat bot or messenger window, it typically appears at the bottom of the chat history while everything else moves up. This way, the user can always see the latest message without the chat window growing endlessly as older messages are visually pushed higher and eventually disappear (though still accessible through scrolling).
I attempted to recreate this behavior using a flex wrapper with flex-direction: column-reverse
for the 'chat history' div, but I'm having trouble figuring it out.
You can view my attempt here: https://codepen.io/chapkovski/full/gOOKGwJ
Currently, the content in the 'chat history' shows from the top, and when a new element is added, the window just expands instead of pushing older items up. Any guidance or tips in the right direction would be much appreciated.