Spaces Cause Strange Behavior in TextArea
July 27, 2007 10:39 AM
Subscribe
At least in Firefox I'm seeing an undesirable behavior in textareas. My question is how to fix/avoid it.
Here's the problem. Go to a textarea in Firefox. (The ask.metafilter ask a question one will do fine.) Type enough characters to fill a whole line of the textarea e.g., kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
Now put a single space in front of that line. It moves the line one line lower instead of just putting a space in front of the characters which is what I would prefer i.e., treat a space like any other character.
It's really driving me crazy on my website where I want to have users format precise code. Let me know if my explanation isn't clear and I'll try to explain it better.
posted by GregX3 to computers & internet (5 comments total)
The first textarea on that page is like metafilter, it wraps. The s econd one has wrap="off" which makes it not wrap, and your kkkkk example should work OK.
When a textarea is in wrap mode, it's *correct* to treat a space differently than other characters, since whitespace is what's used to determine where to wrap.
posted by RustyBrooks at 10:46 AM on July 27, 2007