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
Prevents horizontal scroll #65
Conversation
Thanks for the pull request, but you'll have to demonstrate the problem for me to be able to merge this. If this is really causing an issue then a different solution will have to be found because your commit causes exactly the problem you describe for sites that use |
Maybe your textarea element is wider than the document. |
Good point let me check. |
What about this then? |
Thanks |
Sorry, had to revert the change made here because it break things under IE8 (didn't test other IEs). |
You can still implement your
|
Sorry, beaks how exactly? I have checked in IE and everything is fine. Also I am not changing direction, I just had invisible textarea wider than the document (probably because of |
I also tested it in IE8 native on XP. Autosize was just off. Starts off the wrong size, enlarges at the wrong time, shrinks randomly. Just a mess in IE8, non-emulated. My mistake about the ltr text, I misremembered that being your original fix instead of moving it left. You could still set the width in the CSS, or change the left position:
!important has a higher specificity than the inline style. |
Ok fair enough. However |
I had the exact same issue and the only way to prevent this is to manually add width:0 to the javascript source file.
The problem is that an empty textarea element is always appended to the body tag even when there is no textarea present in the page. And there is no way to fix this via css as you said since there is no class in that textarea element. Should we call the autosize() method only when there is a textarea element in the current page? Or can you fix your code so that the textarea element is appended to the body tag only when there is at least one textarea in the page, something like below:
|
Anything on this issue? |
Setting the width to zero may no longer be necessary. Another user pointed out that they were using a size of 100% on textareas, but padding caused it to be greater than 100%. A recent commit set padding is explicitly to 0 for the mirror element (that may resolve your horizontal scroll issue). However, I will add your line for quicker failure. |
Done: Line 53 in 1baef2a
|
…ied to an empty jQuery collection. (jackmoore#65 (comment))
I have replaced elastic plugin with this one and then found horizontal scroll on the site caused by a hidden
<textarea>
, fixed by moving it further to the left.