| 68 | } |
| 69 | |
| 70 | render () { |
| 71 | let { className, grid, style, autoHeight, trigger, ...other } = this.props; |
| 72 | const { rows, value } = this.state; |
| 73 | |
| 74 | style.minHeight = 'auto'; |
| 75 | if (autoHeight) { |
| 76 | style.resize = 'none'; |
| 77 | } |
| 78 | |
| 79 | const props = { |
| 80 | className: classnames( |
| 81 | className, |
| 82 | getGrid(grid), |
| 83 | 'rct-form-control' |
| 84 | ), |
| 85 | onChange: this.handleChange, |
| 86 | style, |
| 87 | rows, |
| 88 | value |
| 89 | }; |
| 90 | |
| 91 | if (trigger !== 'change') { |
| 92 | let handle = 'on' + trigger.charAt(0).toUpperCase() + trigger.slice(1); |
| 93 | props[handle] = this.handleTrigger; |
| 94 | } |
| 95 | |
| 96 | return ( |
| 97 | <textarea ref={ (c) => this.element = c } { ...other } { ...props } /> |
| 98 | ); |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | Textarea.propTypes = { |