Element: [Bug Report] Space doesn't work in el-autocomplete in el-menu

Created on 13 Dec 2017  ·  5Comments  ·  Source: ElemeFE/element

Element UI version

2.0.8

OS/Browsers version

any

Vue version

2.5.10

Reproduction Link

https://jsfiddle.net/mmx38qxw/107/

Steps to reproduce

Create el-menu with el-autocomplete in it then press space in el-autocomplete element

What is Expected?

Space should work

What is actually happening?

Space doesn't work

autocomplete stale bug

Most helpful comment

https://jsfiddle.net/kulnaura/7oxpzg54/5/
I added wrapper for el-input and used @keydown.stop on it:

...
  <el-menu-item index="1">
    <div @keydown.stop>
      <el-input 
                v-model="keyword" 
                type="text" 
                placeholder="placeholder"
                clearable
                autofocus>
      </el-input>
    </div>
  </el-menu-item>
...

This trick helped me.

All 5 comments

Update:

When space is pressed it is registered as click if I monitor events.
I also found this code in few files (menu.js, aria-menuitem.js,element-ui.common.js)

case keys.space:
case.keys.enter:
  prevDef = true;
  event.currentTarget.click();
  break;

But changing it or commenting space part doesn't do anything.

Hello, we having similar problem because of space press event handler. Any updates?

https://jsfiddle.net/kulnaura/7oxpzg54/5/
I added wrapper for el-input and used @keydown.stop on it:

...
  <el-menu-item index="1">
    <div @keydown.stop>
      <el-input 
                v-model="keyword" 
                type="text" 
                placeholder="placeholder"
                clearable
                autofocus>
      </el-input>
    </div>
  </el-menu-item>
...

This trick helped me.

@alexander-sharecreators , this helped me as well. This was an infuriating bug.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smallpath picture smallpath  ·  3Comments

sudo-suhas picture sudo-suhas  ·  3Comments

fscardua picture fscardua  ·  3Comments

yuchonghua picture yuchonghua  ·  3Comments

PanJiaChen picture PanJiaChen  ·  3Comments