New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
52px height bug #166
Comments
Autosize sets the min-height to be whatever the starting height is. Then it increases the height to fit the text plus autosize's appended whitespace. My guess is that the 52px height is either unrelated to autosize, or it's due to the whitespace autosize is appending at the bottom of the textarea. You can remove the whitespace like so:
However, this buffer of whitespace does help give a smoother resizing in IE10 (see issue #148), and when using CSS transition for the height. |
yeah, i'm having this same issue, but for me, its setting the textarea to 63px. i've tried doing the append:false, no luck. when i don't call autosize on the textarea, then my height is set to 39px which is what i want. but autosize is forcing it to 63px even with append:false. any ideas? |
Could you post a demo that reproduces the problem? |
I'm seeing something similar with code that I thought had been working (I'm sure the append:false fixed this for me a couple months ago). We want a single line textarea that grows as needed (it's in a grid so the '\n' append makes the grid much too tall). http://jsfiddle.net/my1vv96a/1/ The above example works as I'd like in Chrome but the vertical hight is wrong in Firefox. In IE it's not working at all. Any help would be appreciated! |
Fyi, i have the same issue, it works as expected in chrome, but in firefox its bigger vertically than I'd like, in exactly the same way as the jsfiddle. I haven't tested IE 11. |
Having the same problem. Works great in chrome, but in firefox it starts at about double the size. |
@drampelt : Setting the initial height in css(Ex: height: 20px) to the textarea, along with "{append: false}" fixed the issue for me in Firefox P.S: |
@karibtech That worked well for me. I ended up wrapping the $.fn.autosize() to do this automagically: (function() {
var autosize = $.fn.autosize;
$.fn.autosize = function() {
if (bowser.firefox) {
if (this.hasClass("thin")) { // internal class for input box in a grid
this.css("height", "20px");
} else {
this.css("height", "30px");
}
}
autosize(this, arguments);
return this;
};
})(); |
I had this issue because of an unseen whitespace character |
jQuery autosize automatically sets my textarea to 52px:
<textarea class="textarea" name="description" placeholder="Write your comment." style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 52px;"></textarea>I want to make it to have a bit smaller height - 35px. Overwriting styles in any way does not help.
Is there a way to avoid that problem?
The text was updated successfully, but these errors were encountered: