Element: [bug report] autocomplete does not work properly

Created on 16 Apr 2020  ·  15Comments  ·  Source: ElemeFE/element

Element UI version

2.13.1

OS/Browsers version

mac/Google Chrome80.0.3987.163

Vue version

2.6.11

Reproduction Link

https://codepen.io/lliuxs/pen/ExVPMaE

Steps to reproduce

1.将官网上的demo中 输入文字 离开
2.autocomplete的离开触发handleChange事件 这里的event应该是el-input的value值 没有target属性 这样会报错
handleChange: function handleChange(event) {
this.$emit('change', event.target.value);
},

Error in v-on handler: "TypeError: Cannot read property 'value' of undefined"

found in

at packages/input/src/input.vue
at packages/autocomplete/src/autocomplete.vue


What is Expected?

1.不报错
2.正常显示

What is actually happening?

1.handleChange中的event是value 不是event对象 会报错
2.element大佬应该不会犯这种低级错误 感觉是哪个实习生改的吧 这么重要的项目希望大佬们重视下呀

Most helpful comment

Same here. Found this bug from 2.13.1.
Fix the version to 2.13.0 and wait for the 2.13.2 or later.

Hope it will help !

All 15 comments

Translation of this issue:

Element UI version

2.13.1

OS/Browsers version

mac/Google Chrome80.0.3987.163

Vue version

2.6.11

Reproduction Link

https://codepen.io/lliuxs/pen/ExVPMaE

Steps to reproduce

  1. Leave the input text in the demo on the official website

  2. The departure of autocomplete triggers the handlechange event, where the event should be the value of El input without the target attribute, which will result in an error
    handleChange: function handleChange(event) {

this.$emit('change', event.target.value);
}

Error in v-on handler: "TypeError: Cannot read property 'value' of undefined"
Found in

at packages/input/src/input.vue
at packages/autocomplete/src/autocomplete.vue


What is Expected?

  1. no mistake.
  2. Normal display

What is actually happening?

  1. Whether the event in handlechange is value or not the event object will report an error

  2. I don't think you can make such a low-level mistake. Which intern changed it? I hope you pay attention to such an important project

same problem here

Same here. Found this bug from 2.13.1.
Fix the version to 2.13.0 and wait for the 2.13.2 or later.

Hope it will help !

same problem

same problem

same problem

same problem

same problem

same issue here in 2.13.1.
fixed in 2.13.0.

and waiting for a later version.

+1

+1

+1
图片

+1
自己测试
仿佛是:trigger-on-focus="false"属性影响的,如果不设置的话控制台不会报错

+1

in 2.13.2 issue solved

Was this page helpful?
0 / 5 - 0 ratings