mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
Merge pull request #5330 from fanburger/fix/5308
fix(van-field): Invalid maxlength on Android devices
This commit is contained in:
commit
4a3dbff38b
@ -76,6 +76,13 @@ VantComponent({
|
||||
const { value = '' } = event.detail || {};
|
||||
|
||||
this.value = value;
|
||||
|
||||
const { maxlength } = this.data;
|
||||
if (maxlength !== -1 && value.length > maxlength) {
|
||||
this.value = value.slice(0, maxlength);
|
||||
event.detail.value = this.value;
|
||||
}
|
||||
|
||||
this.setShowClear();
|
||||
|
||||
this.emitChange(event.detail);
|
||||
|
Loading…
x
Reference in New Issue
Block a user