I want to make a chat application. my problem is, when my textbox increase it height, the chat-container reduce it height from bottom.
I want the chat container reduce it height from top. For example:
This is my chat-box looklike. And, when my textbox increase it height, it'll show like this
What i expected is like this
And also, when the chat-container is not at bottom, they also reduce it height from top too. like this
This is my code
.chat-container, .chat-content, p, .chat-input {
box-sizing: border-box;
padding: 10px;
border: 2px solid black;
}
.chat-container {
width: 300px;
height: 400px;
display: flex;
flex-direction: column;
}
.chat-content {
width: 100%;
overflow: auto;
flex-grow: 1;
}
.input-here {
width: 100%;
max-height: 150px;
}
.input-here {
border: 2px solid red;
}
<div class="chat-container">
<div class="chat-content">
<p>Hello</p>
<p>This is example words.</p>
<p>This is another example #1</p>
<p>This is another example #2</p>
<p>This is another example #3</p>
<p>This is another example #4</p>
<p>This is another example #5</p>
</div>
<div class="chat-input">
<div contenteditable="true" class="input-here"></div>
</div>
</div>
Sorry for my bad english. Thank you so much.