Hi,
I am using the 'paper-dropdown-menu' and return the selected menu item value back to server by calling req.body.category.
<paper-dropdown-menu name="category" label="Category" required>
<paper-menu attr-for-selected="value" class="dropdown-content">
<paper-item value="Entertainment">Entertainment</paper-item>
<paper-item value="News">News</paper-item>
<paper-item value="Technology">Technology</paper-item>
<paper-item value="Others">Others</paper-item>
</paper-menu>
</paper-dropdown-menu>
However, I am facing the below problem which the "selectedItemLabel'" does return the correct selected value of <paper-item>, but getting the "value" always return 'undefined' result.
var s = document.querySelector('paper-dropdown-menu');
console.log(s.selectedItemLabel); --> OUTPUT 'News' if I select News
console.log(s.value); --> OUTPUT 'undefined'
Further reading the 'value' property from polymer document, it does mentioned that 'label' is a read only String type and "will always have the same value as "selectedItemLabel", which is not TRUE for my case as proven above. Is this a bug or something I did wrong inside my code. Thanks.
Statement for "value" from Polymer paper-dropdown-menu document:
The value for this element that will be used when submitting in a form. It is read only, and will always have the same value as selectedItemLabel
.
Roger