JSFiddle - React, Tailwind, and code Playground
by Joe
HTML
<textarea type="text" class="expand" rows="1" cols="10"></textarea>
CSS
.expand {
height: 1em;
width: 50%;
padding: 3px;
}
JavaScript
$('textarea.expand').focus(function () {
$(this).animate({ height: "5em" }, 500);
});