Skip to content
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

Use of box-sizing: border-box always causes vertical scrollbar in IE #245

Closed
ben-gilbert-smartsheet opened this issue Jul 8, 2015 · 2 comments

Comments

@ben-gilbert-smartsheet
Copy link

May be related to #226.

If you have a TEXTAREA with box-sizing: border-box, then the plugin is setting overflow-y to visible in all IE browsers, causing a vertical scrollbar to appear even though the content fits within the textarea.

In other browsers (tested in Chrome and Firefox), the plugin is setting overflow-y to hidden.

See http://jsfiddle.net/9tqt0z7j/2/. Note that in this example, I'm not setting overflow or overflow-y myself - just box-sizing, padding, and resize, but box-sizing is the only thing that matters.

image

Note: A partial workaround is to set overflow-y: auto!important against the affected TEXTAREA elements. However, in IE 11, there is still a somewhat jarring flicker when the textarea grows - you see the vertical scrollbar appear momentarily and then disappear. Also, for some reason this workaround doesn't work in IE9 - I still get the vertical scrollbar when I put more than two lines of text in the textarea.

@robneild
Copy link

robneild commented Aug 9, 2016

The problem is here

if (style.height !== ta.style.height) {

On IE getComputedStyle().height doesn't adapt to 'border-box' and always returns the inner content area height. However 'ta.style.height' does change and includes the border. So they can't directly be compared. Other browsers adapt both.

I am experimenting with changing to the following

if (ta.scrollHeight > ta.clientHeight) {

@maximmandrik
Copy link

The problem is still not solved (version 3.0.20).
Unfortunately, I, will hardly have time to solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants