ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.1k stars 14.64k forks source link

[Bug Report] el-autocomplete clearable can not trigger suggestion callback #18874

Open zhidanwang19910111 opened 4 years ago

zhidanwang19910111 commented 4 years ago

Element UI version

2.11.1

OS/Browsers version

macOS 10.13 / chrome 79

Vue version

2.6.11

Reproduction Link

https://codepen.io/zhidanwang19910111/pen/GRJmBwg

Steps to reproduce

  1. el-autocomplete input '三', and then click clear icon
  2. then auto focus on input and input '三' again

What is Expected?

after clicking clear icon, auto focus input, and inputing something can show suggestion list

What is actually happening?

suggestion hide,can not show again, unless blur ,and focus again

ray007 commented 4 years ago

The clear-icon produces no event, neither select nor clear or change.

1008611 commented 4 years ago

can use @input,but can not call back... first blur,then focus again can call back

    handleInput() {
        console.log(this.selectValue)
        if (this.selectValue == '') {
          this.resultOptions = []
          this.$refs.mInput.$el.querySelector('input').blur()
          this.$nextTick(() => {
             this.$refs.mInput.focus()
          })
        }
      },
stale[bot] commented 3 years ago

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.