The solution here works for changing the height dynamically.
1. I need it to auto-shorten the height of the textarea when text is erased (the reverse of what is doing now )
2. I also need that the width of the textarea resizes automatically (shorten or lenghten)
So it will enlarge till reaching a max-width, then will start increasing the height.