jd-opensource / jd-opensource/taro-ui

Input组件maxLength设置不起作用

Open
#1,198 20 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

### Taro UI 版本信息

v2.3.4

### 问题描述

maxLength属性设置以后,不能限制用户输入,超过maxLength以后,仍旧可以输入

### 复现代码

```

```

### 补充信息

微信小程序的input组件的maxlength属性设置是可以的,查看taro ui的源代码后,发现源代码中的属性错了

taro ui:
```

```

taro:
```
{
this.inputRef = input!
autoFocus && input?.focus()
}}
class='weui-input'
value={fixControlledValue(value)}
type={getTrueType(type, confirmType, password)}
placeholder={placeholder}
disabled={disabled}
maxlength={maxlength}
autofocus={autoFocus}
name={name}
onInput={this.hanldeInput}
onFocus={this.handleFocus}
onBlur={this.handleBlur}
onChange={this.handleChange}
onKeyDown={this.handleKeyDown}
/>
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.