Element: [Bug Report] Errors are reporting when the form textarea box is newline: Cannot read property'type'of undefined

Created on 4 Mar 2019  ·  6Comments  ·  Source: ElemeFE/element

Element UI version

2.6.0

OS/Browsers version

Chorme 72.0.3626.119

Vue version

2.5.18

Reproduction Link

https://jsfiddle.net/api/post/library/pure/

Steps to reproduce

官方网站示例:
http://element-cn.eleme.io/#/zh-CN/component/form

典型表单 - 活动形式

文本款内换行时,会出现

Uncaught TypeError: Cannot read property 'type' of undefined
at e.setFieldValue (onloadwff.js:71)
at HTMLFormElement.formKeydownListener (onloadwff.js:71)

What is Expected?

不应该有报错

What is actually happening?

这里是将textarea当成form表单内普通的input处理,由于field为undefined,导致报错

All 6 comments

Translation of this issue:

Element UI version

2.6.0

OS/Browsers version

Chorme 72.0.3626.119

Vue version

2.5.18

Reproduction Link

https://jsfiddle.net/api/post/library/pure/

Steps to reproduce

Examples of official websites:

Http://element-cn.eleme.io/#/zh-CN/component/form
Typical form-activity form

When a line is changed in a text paragraph, it will appear
Uncaught TypeError: Cannot read property'type'of undefined

At E. setField Value (onloadwff. js: 71)
At HTML FormElement. FormKeydownListener (onloadwff. js: 71)

What is Expected?

There should be no mistake.

What is actually happening?

Here, textarea is treated as a normal input in the form, which results in an error due to undefined field.

Hi, your JSFiddle page is blank because it seems you forgot to click the Save button. Please save your fiddle and then edit this issue with the new link.

Issues without a valid reproduction link will be closed directly.

image
坐标广州,翻不翻都无法打开jsfiddle.net,直接通过官方表单示例是可以看到的,在文本框内回车换行,控制台会报错

Issues without a valid reproduction link will be closed directly.

im having the same issue.

官网就能复现啊...

Was this page helpful?
0 / 5 - 0 ratings