Juravenator / paper-dropdown-input

A paper-input that provides the user with input suggestions
MIT License
20 stars 14 forks source link

selected-item does not work occasionally #12

Open Damianruizz opened 6 years ago

Damianruizz commented 6 years ago

I am using the element as follows:

`

`

The element shows me the list of items without problems. The problem is when you get the information of the selected item, when you click on the item, the value of the locationItem variable is null, the result is shown until you click on the same item. That is, you have to double click on the item to show the result.

I'm using an observer in the variable locationItem

static get observers() {
  return [
    'processLocationSelection(locationItem)',
  ]
}

And the function looks like this

processLocationSelection(locationItem) {
  console.log(locationItem); //is null in the first click
  if (locationItem) {
    console.log(locationItem); // has value in the second click
  }
}