views:

822

answers:

3

Hi,

I have a textarea with overflow-x: auto; attributed to it. It works great when a user is typing text into the box by hand. When a user copy pastes a line from a file, however, that is bigger than my textarea, the overflow-x property does not work, instead the textarea wordwraps the long line.

Is there a way (maybe javascript) to make overflow-x work on copy-paste?

Thanks.

A: 

From the looks of it, it would seem that the text comes pre-wordwrapped from the editor. What editor are you using, and on which platform are you experiencing this behaviour?

dguaraglia
A: 

It's not pre-wrapped. Currently I am using Smultron on Mac OS X with word-wrap turned off.

+1  A: 

I'm not sure what you are trying to achieve - is that for the text area to automatically expand when user types text in? I couldn't create such a behavior using just HTML and CSS.

You can theoretically set your textarea wrap attribute to "no" which will force the creating of a horizontal scrollbar when users type in or paste in long lines.

Guss