element [Bug Report] el-autocomplete sets clearable to enter no selection again

14ifxucb  于 2022-10-26  发布在  其他
关注(0)|答案(5)|浏览(175)

Element UI version

2.12.0

OS/Browsers version

mac

Vue version

2.6.10

https://jsfiddle.net/mmx38qxw/

Steps to reproduce

1.输入三出现下拉的建议
2.点击小叉叉 clearable
3.再次输入三不出现下拉的建议选择

What is Expected?

再次输入三 可以出现下拉选择的

What is actually happening?

数据时cb获取到了 要先失去光标 然后再获取广告才能显示出下拉的选择建议项

oiopk7p5

oiopk7p51#

Translation of this issue:

Element UI version

2.12.0

OS/Browsers version

Mac

Vue version

2.6.10

Https://jsfiddle.net/mmx38qxw/

Steps to reproduce

  1. Suggestions for a drop-down in Input 3
  2. Click on the small fork clearable
  3. Enter three again without a drop-down recommendation

What is Expected?

The drop-down selection can occur by re-entering three

What is actually happening?

When the data is available, the CB gets the suggestion that the cursor must be lost before the advertisement can be retrieved to show the drop-down selection.

vpfxa7rd

vpfxa7rd3#

I have this issue too.

c8ib6hqw

c8ib6hqw4#

I encountered the issue and wrote the following code as temporary solution. Hope it helps someone.

<el-autocomplete ref="autocomplete" @clear="onClearAutocomplete">
onClearAutocomplete() {
    this.$refs.autocomplete.$children
        .find(c => c.$el.className.includes('el-input'))
        .blur();
    this.$refs.autocomplete.focus();
},
6za6bjd0

6za6bjd05#

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

相关问题