Reputation: 3207
I'm listening to the paper-menu-button
selection through the on-core-select
event.
<paper-menu-button icon="menu" on-core-select="{{ selectedItem }}">
<paper-item label="item 1"></paper-item>
<paper-item label="item 2"></paper-item>
</paper-menu-button>
In the Dart side:
void selectedItem(event, detail, target) {
print('SELECTED ${detail}');
}
How can I get the selected item?
I've tried through the detail
parameter but looks like an "empty" object (inspected through reflections and there are no relevant fields).
Upvotes: 1
Views: 387
Reputation: 657298
print(detail['isSelected']); // ignore when false
print(item['detail'].label);
The debugger in WebStorm shows the items of an JavaScript object which is a nice feature.
Upvotes: 2