Skip to content

Commit 315416e

Browse files
committed
fix: 修复 Input 组件 maxlength 拼写问题
1 parent 1c2a713 commit 315416e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/taro-ui/src/components/input/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ import {
1515

1616
type PickAtInputProps = Pick<
1717
AtInputProps,
18-
'maxLength' | 'disabled' | 'password'
18+
'maxlength' | 'disabled' | 'password'
1919
>
2020
type GetInputPropsReturn = PickAtInputProps & Pick<InputProps, 'type'>
2121

2222
function getInputProps(props: AtInputProps): GetInputPropsReturn {
2323
const actualProps = {
2424
type: props.type,
25-
maxLength: props.maxLength,
25+
maxLength: props.maxlength,
2626
disabled: props.disabled,
2727
password: false
2828
}
@@ -129,7 +129,7 @@ export default class AtInput extends React.Component<AtInputProps> {
129129
value,
130130
required
131131
} = this.props
132-
const { type, maxLength, disabled, password } = getInputProps(this.props)
132+
const { type, maxlength, disabled, password } = getInputProps(this.props)
133133

134134
const rootCls = classNames(
135135
'at-input',
@@ -171,7 +171,7 @@ export default class AtInput extends React.Component<AtInputProps> {
171171
placeholderClass={placeholderCls}
172172
placeholder={placeholder}
173173
cursorSpacing={cursorSpacing}
174-
maxLength={maxLength}
174+
maxlength={maxlength}
175175
autoFocus={autoFocus}
176176
focus={focus}
177177
value={value}
@@ -223,7 +223,7 @@ AtInput.defaultProps = {
223223
selectionStart: -1,
224224
selectionEnd: -1,
225225
adjustPosition: true,
226-
maxLength: 140,
226+
maxlength: 140,
227227
type: 'text',
228228
disabled: false,
229229
border: true,
@@ -252,7 +252,7 @@ AtInput.propTypes = {
252252
selectionEnd: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
253253
adjustPosition: PropTypes.bool,
254254
cursorSpacing: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
255-
maxLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
255+
maxlength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
256256
type: PropTypes.string,
257257
disabled: PropTypes.bool,
258258
border: PropTypes.bool,

packages/taro-ui/src/components/search-bar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default class AtSearchBar extends React.Component<
128128
value={value}
129129
focus={isFocus}
130130
disabled={disabled}
131-
maxLength={maxLength}
131+
maxlength={maxLength}
132132
onInput={this.handleChange}
133133
onFocus={this.handleFocus}
134134
onBlur={this.handleBlur}

0 commit comments

Comments
 (0)