Element: [Bug Report] el-autocomplete does not show items from callback

Created on 1 Oct 2018  ·  1Comment  ·  Source: ElemeFE/element

Element UI version

2.4.8

OS/Browsers version

Windows 10 / Chrome 69

Vue version

2.5.17

Reproduction Link

https://jsfiddle.net/WoJWoJ/zhej0n5a/

Steps to reproduce

I tried to use the el-autocomplete tag with the simplest version: an Array returned by the callback function. The suggestion box is visually empty, depite DevTools showing the expected elements in <ElAutocompleteSuggestions>datasuggestions

image

image

What is Expected?

That the suggestions are visible

What is actually happening?

The suggestions, while being apparently present in the dropdown code, are not visible

Most helpful comment

What needs to be passed via the callback is an Object which must have a property called value. This property holds what is displayed as the suggestion.

For the example above:

filterUsers(user, cb) {
      console.log(user)
      cb([{'value': 'qqq', 'whatever': 'djhjfh'}, {'value': 'zzz', 'whatever': 'uiuiiu'}])
    },

I am not sure the key needs to be value but it looks so.

>All comments

What needs to be passed via the callback is an Object which must have a property called value. This property holds what is displayed as the suggestion.

For the example above:

filterUsers(user, cb) {
      console.log(user)
      cb([{'value': 'qqq', 'whatever': 'djhjfh'}, {'value': 'zzz', 'whatever': 'uiuiiu'}])
    },

I am not sure the key needs to be value but it looks so.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FranzSkuffka picture FranzSkuffka  ·  3Comments

yuchonghua picture yuchonghua  ·  3Comments

Zhao-github picture Zhao-github  ·  3Comments

mochenxm picture mochenxm  ·  3Comments

fscardua picture fscardua  ·  3Comments