PDA

View Full Version : Textarea scrollbar doesn't disappear despite width:0



Rain Lover
04-26-2014, 02:17 AM
No scrollbar in Chrome, but in Firefox and IE, it doesn't disappear although the element width is 0:
DEMO (http://jsfiddle.net/vJK5W/)

What's the reason? What's a cross-browser solution so the textarea behaves like in Chrome?

Beverleyh
04-26-2014, 06:03 AM
Browsers behave differently but this looks like a solution (haven't tried - on iPhone) http://stackoverflow.com/questions/19424887/remove-scrollbars-from-textarea

Rain Lover
04-26-2014, 08:27 AM
Browsers behave differently but this looks like a solution (haven't tried - on iPhone) http://stackoverflow.com/questions/19424887/remove-scrollbars-from-textarea

Adding overflow:hidden; completely removes the scrollbar and scrolling feature even if you change the width size value to something larger. As I said it should behave like in Chrome.

Beverleyh
04-26-2014, 09:15 AM
Adding overflow:hidden; completely removes the scrollbar and scrolling feature
Yes I'm aware of that. I'm not sure why you specifically highlighted the overflow:hidden part though? How about the other 2 noted css properties? I was think more of overflow:auto (or overflow-y:auto) so the scrollbar only appears when the contents exceed the field size? I can't test as I'm on iPhone at the moment but how do they fair?

It might just be one of those things though - like I said, browsers behave differently and there are some things that you can't force them to do no matter how much you'd like.

That being said, there may be a JavaScript solution but I'm not sure that its a good idea to interfere with the default behaviour of a browser