Skip to content

Commit

Permalink
fix: 修复 Input 组件 maxlength 拼写问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Garfield550 committed Jul 2, 2020
1 parent 1c2a713 commit 315416e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions packages/taro-ui/src/components/input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import {

type PickAtInputProps = Pick<
AtInputProps,
'maxLength' | 'disabled' | 'password'
'maxlength' | 'disabled' | 'password'
>
type GetInputPropsReturn = PickAtInputProps & Pick<InputProps, 'type'>

function getInputProps(props: AtInputProps): GetInputPropsReturn {
const actualProps = {
type: props.type,
maxLength: props.maxLength,
maxLength: props.maxlength,
disabled: props.disabled,
password: false
}
Expand Down Expand Up @@ -129,7 +129,7 @@ export default class AtInput extends React.Component<AtInputProps> {
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',
Expand Down Expand Up @@ -171,7 +171,7 @@ export default class AtInput extends React.Component<AtInputProps> {
placeholderClass={placeholderCls}
placeholder={placeholder}
cursorSpacing={cursorSpacing}
maxLength={maxLength}
maxlength={maxlength}
autoFocus={autoFocus}
focus={focus}
value={value}
Expand Down Expand Up @@ -223,7 +223,7 @@ AtInput.defaultProps = {
selectionStart: -1,
selectionEnd: -1,
adjustPosition: true,
maxLength: 140,
maxlength: 140,
type: 'text',
disabled: false,
border: true,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-ui/src/components/search-bar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 315416e

Please sign in to comment.