Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

line-height, padding should be added to copyStyle #3

unlight opened this Issue Nov 14, 2011 · 5 comments


None yet
3 participants

unlight commented Nov 14, 2011

No description provided.


jackmoore commented Nov 14, 2011

I don't know how to get an accurate value for line-height for textarea elements in IE. If you try to get the line-height of a textarea, it returns bogus data like "normal" or "1px". Things that are clearly wrong when compared to the stylesheet.

Autosize will automatically have the correct line-height if you set the line-height in the CSS to the base textarea element. Example:

textarea {line-height:1.5;}

Autosize takes in an optional class name for the mirror element, so if the textarea elements on your page have varying line-heights, you can give it a classname to put on the mirror element in order to style it through the stylesheet so that the correct line-height will be able to be applied in IE. Example:

.signup { line-height:2; }

$('#signup textarea').autosize('signup');


jackmoore commented Nov 14, 2011

Padding doesn't need to be copied, it isn't needed for any of the calculations being done. It should work fine for any padding that is set.

unlight commented Nov 14, 2011

My textarea after autosize() always has scroll (extra 20-50px). After adding lineHeight to copyStyle it is looking almost good.


jackmoore commented Nov 14, 2011

Did you read my comment about line-height? I imagine it is broken in IE at least through version 8.

lenar commented Mar 24, 2012

@unlight: maybe my additions in #5 for quirks mode will help with the padding

@jackmoore jackmoore closed this May 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment