[bugfix] Field: cut off charactor input when use maxlength (#2295)

This commit is contained in:
neverland
2018-12-15 16:53:06 +08:00
committed by GitHub
parent ebef4d3d3d
commit f60541c396
+1 -1
View File
@@ -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;
}