From 315416ed0890966fe563308d3365576d48ac356c Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Fri, 3 Jul 2020 02:54:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Input=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=20maxlength=20=E6=8B=BC=E5=86=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-ui/src/components/input/index.tsx | 12 ++++++------ packages/taro-ui/src/components/search-bar/index.tsx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/taro-ui/src/components/input/index.tsx b/packages/taro-ui/src/components/input/index.tsx index 7b20b45ba..b6a82ef2f 100644 --- a/packages/taro-ui/src/components/input/index.tsx +++ b/packages/taro-ui/src/components/input/index.tsx @@ -15,14 +15,14 @@ import { type PickAtInputProps = Pick< AtInputProps, - 'maxLength' | 'disabled' | 'password' + 'maxlength' | 'disabled' | 'password' > type GetInputPropsReturn = PickAtInputProps & Pick function getInputProps(props: AtInputProps): GetInputPropsReturn { const actualProps = { type: props.type, - maxLength: props.maxLength, + maxLength: props.maxlength, disabled: props.disabled, password: false } @@ -129,7 +129,7 @@ export default class AtInput extends React.Component { value, required } = this.props - const { type, maxLength, disabled, password } = getInputProps(this.props) + const { type, maxlength, disabled, password } = getInputProps(this.props) const rootCls = classNames( 'at-input', @@ -171,7 +171,7 @@ export default class AtInput extends React.Component { placeholderClass={placeholderCls} placeholder={placeholder} cursorSpacing={cursorSpacing} - maxLength={maxLength} + maxlength={maxlength} autoFocus={autoFocus} focus={focus} value={value} @@ -223,7 +223,7 @@ AtInput.defaultProps = { selectionStart: -1, selectionEnd: -1, adjustPosition: true, - maxLength: 140, + maxlength: 140, type: 'text', disabled: false, border: true, @@ -252,7 +252,7 @@ AtInput.propTypes = { selectionEnd: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), adjustPosition: PropTypes.bool, cursorSpacing: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - maxLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), + maxlength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), type: PropTypes.string, disabled: PropTypes.bool, border: PropTypes.bool, diff --git a/packages/taro-ui/src/components/search-bar/index.tsx b/packages/taro-ui/src/components/search-bar/index.tsx index 27987c58b..ec7e11848 100644 --- a/packages/taro-ui/src/components/search-bar/index.tsx +++ b/packages/taro-ui/src/components/search-bar/index.tsx @@ -128,7 +128,7 @@ export default class AtSearchBar extends React.Component< value={value} focus={isFocus} disabled={disabled} - maxLength={maxLength} + maxlength={maxLength} onInput={this.handleChange} onFocus={this.handleFocus} onBlur={this.handleBlur}