Element: [Bug Report] When validation forms are used, the @keyup.enter time of a form with only one element input binding refreshes the page

Created on 26 Sep 2018  ·  4Comments  ·  Source: ElemeFE/element

Element UI version

2.4.7

OS/Browsers version

谷歌浏览器/win10

Vue version

2.5.17

Reproduction Link

https://jsfiddle.net/Lv6rpfqk/11/?utm_source=website&utm_medium=embed&utm_campaign=Lv6rpfqk

Steps to reproduce

1.打开重现链接
2.选中选择框,不输入任何信息
3.直接回车
4.发现跳转页面404
5.分析发现只有当表单只有一个元素的时候,才会出现的行为

What is Expected?

不跳转页面

What is actually happening?

发现跳转页面,没有进入函数。

Most helpful comment

sorry I didn't find the answer.And I think the problem has not been solved.I have use '@keyup.enter.native' to bind .

All 4 comments

Translation of this issue:

Element UI version
2.4.7

OS/Browsers version
Google browser /win10

Vue version
2.5.17

Reproduction Link
https://jsfiddle.net/Lv6rpfqk/11/? Utm_source = website & utm_medium = embedded & utm_campaign = Lv6rpfqk

Steps to reproduce

  1. open the link again.
  1. select the selection box and do not enter any information.
  2. direct return

  3. find jump page 404

  4. analysis finds that behavior occurs only when a form has only one element.

What is Expected?
No jump page

What is actually happening?
Found that the jump page did not enter the function.

Hi, please read the FAQ before submitting an issue. The answer to this question can be found there.

sorry I didn't find the answer.And I think the problem has not been solved.I have use '@keyup.enter.native' to bind .

@mingmLiang you need to handle the event with .prevent

<el-input @keydown.native.enter.prevent="handleSubmit"></el-input>
Was this page helpful?
0 / 5 - 0 ratings