views:

4495

answers:

2

I'm using textarea components in my application, and I control their height dynamically. As the user types, the height is increased whenever there is enough text. This works fine on IE, Firefox, and Safari.

However, in Safari, there is a "handle" tool in the lower right that allows user to resize the textarea by clicking and dragging. I also noticed this issue with the textarea in the stackoverflow Ask a Question page. This tool is confusing and basically gets in the way.

So, is there anyway to hide this resize handle?

(I'm not sure if "handle" is the right word, but I cannot think of a better term.)

+23  A: 

You can override the resize behaviour with CSS:

textarea
{
   resize: none;
}

or just simply

<textarea style="resize: none;">TEXT TEXT TEXT</textarea>

Valid properties are: both, horizontal, vertical, none

DrJokepu
Not strictly relevant here, but Safari also respects the min-height, max-height, min-width, and max-width CSS properties to leave resizing enabled but place limits on how far it can resize.
stevemegson
Thank you! Was about to ask this same question :)
alex
What if I want to show it on hover after I've set resize:none ?
Michael Forrest
@Michael Forrest: have you tried textarea:hover { resize: inherit !important; } ? I have never tried it, just a guess.
DrJokepu
A: 

the safari max-height max-width opportunity also works in firefox 4.0 (b3pre). good example here by the way: http://www.alanedwardes.com/posts/safari-and-resizable-textboxes/

fortrabbit-frank