Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Selecting Item Programmatically #3

Closed
DeveloperUX opened this issue Sep 4, 2014 · 1 comment
Closed

Selecting Item Programmatically #3

DeveloperUX opened this issue Sep 4, 2014 · 1 comment

Comments

@DeveloperUX
Copy link

I was trying to set the currently selected item in the Core Dropdown programmatically using selectedItem.

The code looks like this:

List<Item> items = toObservable( [
  {"id": "A", "name": "Apple"},   
  {"id": "B", "name": "Ball"}, 
  {"id": "C", "name": "Cat"}
] );
CoreDropdown dropdown = shroot.querySelector("core-dropdown");
dropdown.selectedItem = items[0].id;

Edit:
I believe the issue was closed. Last comment I read was to use dropdown.selected instead. I also tried that, but had the same issue.

@morethanreal
Copy link

The dropdown is changed to not contain a selector. You can nest a core-selector or similar if you need this functionality.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants