Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selected-item does not work occasionally #12

Open
Damianruizz opened this issue Nov 8, 2017 · 0 comments
Open

selected-item does not work occasionally #12

Damianruizz opened this issue Nov 8, 2017 · 0 comments

Comments

@Damianruizz
Copy link

I am using the element as follows:

<paper-dropdown-input label="Locación" items="[[userLocations]]" selected-item="{{locationItem}}" filter-property="location_name"> <template> <template is="dom-repeat" items="[[items]]" as="item"> <paper-item id-loc="[[item.location_id]]" name-loc="[[item.location_name]]">[[item.location_id]] - [[item.location_name]]</paper-item> </template> </template> </paper-dropdown-input>

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
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant