nuke-input
Advanced tools
Comparing version 1.0.32 to 1.0.33
@@ -58,9 +58,9 @@ # Input Demo | ||
<Page.Intro main="renderCount"></Page.Intro> | ||
<Page.Intro main="maxRows 3"></Page.Intro> | ||
<View style={styles.demoBlock}> | ||
<Input multiple floatPlaceholder={false} maxRows={5} maxLength={250} onInput={this.checkLength} renderCount={true} type="text" placeholder="milti-line input label" /> | ||
<Input multiple floatPlaceholder={false} maxRows={3} maxLength={250} onInput={this.checkLength} renderCount={true} type="text" placeholder="milti-line input label" /> | ||
</View> | ||
<Page.Intro main="always error"></Page.Intro> | ||
<Page.Intro main="error"></Page.Intro> | ||
<View style={styles.demoBlock}> | ||
<Input multiple maxLength={20} maxRows={8} value={this.state.value} onInput={this.checkLength} renderCount={false} errorMessage="error" renderError={true} renderClear={true} type="text" status={this.state.status2} placeholder="milti-line input label" /> | ||
<Input multiple maxRows={8} value={this.state.value} onInput={this.checkLength} renderCount={false} errorMessage="error" renderError={true} renderClear={true} type="text" status={this.state.status2} placeholder="milti-line input label" /> | ||
</View> | ||
@@ -67,0 +67,0 @@ </Page> |
# Changelog | ||
## 1.0.33 / 2017-12-29 | ||
* [[ca63c54](http://gitlab.alibaba-inc.com/nuke/input/commit/ca63c543b8a5054ac8ead938c39fb45a89efce10)] - `fix` fix autoadjust height in web | ||
## 1.0.32 / 2017-12-28 | ||
@@ -5,0 +9,0 @@ |
@@ -174,8 +174,13 @@ 'use strict'; | ||
var maxRows = this.props.maxRows; | ||
// debugger; | ||
var outerHeight = parseInt(window.getComputedStyle(el).height, 10); | ||
var diff = outerHeight - el.clientHeight; | ||
var max = Math.min(this.minHeight * maxRows, el.scrollHeight + diff); | ||
var autoHeight = Math.max(this.minHeight, el.scrollHeight + diff); | ||
el.style.height = 0; | ||
el.style.height = Math.max(this.minHeight, max) + 'px'; | ||
if (autoHeight > this.minHeight * maxRows) { | ||
el.style.height = this.minHeight * maxRows + 'px'; | ||
} else { | ||
el.style.height = Math.max(this.minHeight, el.scrollHeight + diff) + 'px'; | ||
} | ||
} | ||
@@ -182,0 +187,0 @@ }, { |
{ | ||
"name": "nuke-input", | ||
"version": "1.0.32", | ||
"version": "1.0.33", | ||
"description": "输入框", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
138499
2002