bgrins / ExpandingTextareas

jQuery plugin for elegant expanding textareas
http://bgrins.github.com/ExpandingTextareas/
MIT License
260 stars 73 forks source link

set height of container to match textarea #28

Closed cbergen closed 11 years ago

cbergen commented 11 years ago

Because the textarea is position:absolute, the height of the container collapses to match the pre element. This fixes that.

bgrins commented 11 years ago

Do you have a case where this is an issue? I'm happy to merge, I'd just like to see a before/after comparison so I could maybe add it to the demo page.

cbergen commented 11 years ago

I guess this change has the same effect as adding:

textarea, .textareaClone {
    min-height:4em;
}

..except there's no need for including the ".textareaClone" selector. Changing the CSS in Javascript makes the plugin a little more modular since (at least for basic usage) the CSS doesn't need to know anything about how the Javascript works.

Here's a fiddle showing the problem I had: http://jsfiddle.net/f2BNQ/ You can solve the problem by either uncommenting the CSS or line 102 in the Javascript.

bgrins commented 11 years ago

Thanks!