react-textarea
v1.0.4
Published
React Textarea
Downloads
9
Maintainers
Readme
react-textarea
<textarea />
replacement
with autoGrow
and resize
support
Motivation
Most often you only need the textarea
value
on theonChange
handler. Just as often, you don't needchange
event propagation.autoGrow
is a very nice to have feature on a textarea. Coupled withmaxHeight
andresize
Props
onChange(value: String [, event ]): Function
- theonChange
handler will be called with the textarea value, not theevent
object as first argument. Theevent
object is the second arg to the callback function.stopChangePropagation: Boolean
- defaults to true. By default, the propagation of the change event will be stopped. All other evens will work as usual. Set this prop tofalse
to allowchange
event propagation.autoGrow: Boolean
- defaults to true.resize: Boolean|String
- defaults to true - making the textarea resizable in both directions. Passfalse
orString
to change this behaviour.maxHeight: Number|String
- the max height the textarea can have.
Development
$ npm run dev
and navigate to localhost:9090
.
Related
See react-field for <input />
replacement.
Thanks
Thanks to @andreypopp and his initial implementation at https://github.com/andreypopp/react-textarea-autosize