Skip to content

Commit 9e738a8

Browse files
authored
Input: not trigger form validation when input (#12260)
* Input: not trigger validation when input * InputNumber: update docs
1 parent b1be1f4 commit 9e738a8

File tree

5 files changed

+14
-19
lines changed

5 files changed

+14
-19
lines changed

examples/docs/en-US/input-number.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Allows you to define incremental steps.
121121
:::
122122

123123
:::tip
124-
The value of `precision` must be a positive integer and should not be less than the decimal places of `step`.
124+
The value of `precision` must be a non negative integer and should not be less than the decimal places of `step`.
125125
:::
126126

127127
### Size

examples/docs/es/input-number.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Le permite definir el nivel de incremento de los saltos.
121121
:::
122122

123123
:::tip
124-
The value of `precision` must be a positive integer and should not be less than the decimal places of `step`.
124+
The value of `precision` must be a non negative integer and should not be less than the decimal places of `step`.
125125
:::
126126

127127
### Tamaño

examples/docs/zh-CN/input-number.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
:::
121121

122122
:::tip
123-
`precision` 的值必须是一个正整数,并且不能小于 `step` 的小数位数。
123+
`precision` 的值必须是一个非负整数,并且不能小于 `step` 的小数位数。
124124
:::
125125

126126
### 尺寸

packages/form/src/form-item.vue

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,16 @@
120120
}
121121
return parent;
122122
},
123-
fieldValue: {
124-
cache: false,
125-
get() {
126-
const model = this.form.model;
127-
if (!model || !this.prop) { return; }
123+
fieldValue() {
124+
const model = this.form.model;
125+
if (!model || !this.prop) { return; }
128126
129-
let path = this.prop;
130-
if (path.indexOf(':') !== -1) {
131-
path = path.replace(/:/, '.');
132-
}
133-
134-
return getPropByPath(model, path, true).v;
127+
let path = this.prop;
128+
if (path.indexOf(':') !== -1) {
129+
path = path.replace(/:/, '.');
135130
}
131+
132+
return getPropByPath(model, path, true).v;
136133
},
137134
isRequired() {
138135
let rules = this.getRules();

packages/input/src/input.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
},
204204
205205
watch: {
206-
'value'(val, oldValue) {
206+
value(val, oldValue) {
207207
this.setCurrentValue(val);
208208
}
209209
},
@@ -283,10 +283,8 @@
283283
if (this.isOnComposition && value === this.valueBeforeComposition) return;
284284
this.currentValue = value;
285285
if (this.isOnComposition) return;
286-
this.$nextTick(_ => {
287-
this.resizeTextarea();
288-
});
289-
if (this.validateEvent) {
286+
this.$nextTick(this.resizeTextarea);
287+
if (this.validateEvent && this.currentValue === this.value) {
290288
this.dispatch('ElFormItem', 'el.form.change', [value]);
291289
}
292290
},

0 commit comments

Comments
 (0)