fix(Field): should not submit form on enter (#6240)
This commit is contained in:
+9
-4
@@ -353,10 +353,15 @@ export default createComponent({
|
||||
},
|
||||
|
||||
onKeypress(event) {
|
||||
// trigger blur after click keyboard search button
|
||||
/* istanbul ignore next */
|
||||
if (this.type === 'search' && event.keyCode === 13) {
|
||||
this.blur();
|
||||
const ENTER_CODE = 13;
|
||||
|
||||
if (event.keyCode === ENTER_CODE) {
|
||||
preventDefault(event);
|
||||
|
||||
// trigger blur after click keyboard search button
|
||||
if (this.type === 'search') {
|
||||
this.blur();
|
||||
}
|
||||
}
|
||||
|
||||
this.$emit('keypress', event);
|
||||
|
||||
Reference in New Issue
Block a user