MCPcopy Create free account
hub / github.com/Lobos/react-ui / autoHeight

Method autoHeight

src/Textarea.js:53–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 1

handleChangeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected