mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Field: cut off charactor input when use maxlength (#2295)
This commit is contained in:
parent
ebef4d3d3d
commit
f60541c396
@ -146,7 +146,7 @@ export default create({
|
||||
let { value } = target;
|
||||
const { maxlength } = this.$attrs;
|
||||
|
||||
if (this.isDef(maxlength) && value.length > maxlength) {
|
||||
if (this.type === 'number' && this.isDef(maxlength) && value.length > maxlength) {
|
||||
value = value.slice(0, maxlength);
|
||||
target.value = value;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user