()
| 51 | } |
| 52 | |
| 53 | autoHeight () { |
| 54 | let el = this.element; |
| 55 | let scrH; |
| 56 | let rows; |
| 57 | |
| 58 | el.style.height = '1px'; |
| 59 | scrH = el.scrollHeight - this.paddingHeight; |
| 60 | rows = Math.floor( scrH / this.lineHeight); |
| 61 | |
| 62 | if( rows >= this.props.rows ){ |
| 63 | this.setState({ |
| 64 | rows |
| 65 | }); |
| 66 | } |
| 67 | el.style.height = 'auto'; |
| 68 | } |
| 69 | |
| 70 | render () { |
| 71 | let { className, grid, style, autoHeight, trigger, ...other } = this.props; |