feat(Form): add submit-on-enter prop (#6336)

This commit is contained in:
neverland
2020-05-21 19:21:49 +08:00
committed by GitHub
parent 96ef2557c2
commit 877ebd6054
4 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -356,8 +356,8 @@ export default createComponent({
const ENTER_CODE = 13;
if (event.keyCode === ENTER_CODE) {
// should not submit form on etner
if (this.type !== 'textarea') {
const submitOnEnter = this.getProp('submitOnEnter');
if (!submitOnEnter && this.type !== 'textarea') {
preventDefault(event);
}