I have a textarea that expand up from bottom. I also want that the parent div will expand with him.
JS
const [value, setValue] = useState("");
const rows = value.split("\n").length;
<div className='right-bottom'>
<textarea type="text" className="chat-box" value={value} rows={rows}
onChange={(e) => setValue(e.target.value)} style={{ height: "unset" }} />
</div>
CSS
.right-bottom{
background-color: black;
float: right;
width: 33vw;
height: 7vh;
position: relative;
}
.chat-box{
width: 70%;
border-radius: 25px;
border: solid 1px #b7b7b7;
background-color: #eeeeee;
margin-left: 2%;
margin-bottom: 1%;
padding-left: 3%;
padding-right: 3%;
padding-top: 2%;
padding-bottom: 2%;
margin-top:0.5%;
resize: none;
vertical-align: middle;
overflow: hidden;
position: absolute;
bottom: 0;
max-height: 13vh;
}
I want that the black parent div will expand also with the textarea: