We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a48482f commit 69284dbCopy full SHA for 69284db
src/input.js
@@ -6,6 +6,7 @@ import {
6
export default class Input extends Component {
7
static defaultProps = {
8
defaultHeight: 0,
9
+ maxHeight: null,
10
}
11
12
constructor() {
@@ -27,8 +28,9 @@ export default class Input extends Component {
27
28
29
setHeight(newHeight){
30
// Add some extra margin to prevent flickering
31
+ const { defaultHeight, maxHeight = newHeight} = this.props
32
this.setState({
- height: Math.max(this.props.defaultHeight, newHeight) + 25,
33
+ height: Math.max(defaultHeight, newHeight > maxHeight ? maxHeight : newHeight) + 10,
34
});
35
36
0 commit comments