diff --git a/demo/index.html b/demo/index.html
index 6bb23be..fee90cb 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -90,6 +90,21 @@
Disabled
diff --git a/paper-dropdown-menu.html b/paper-dropdown-menu.html
index 3701aec..a14c58f 100644
--- a/paper-dropdown-menu.html
+++ b/paper-dropdown-menu.html
@@ -223,8 +223,9 @@
/**
* 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`.
+ * a form. It is read only, and will default to the same value
+ * as `selectedItemLabel` but can be customized with `attrForSelected`
+ * attribute on the contained list item.
*/
value: {
type: String,
@@ -390,15 +391,16 @@
* optional `label` property.
*/
_selectedItemChanged: function(selectedItem) {
- var value = '';
- if (!selectedItem) {
- value = '';
- } else {
- value = selectedItem.label || selectedItem.textContent.trim();
+ var value = '',
+ label = '';
+
+ if (selectedItem) {
+ label = selectedItem.label || selectedItem.textContent.trim();
+ value = selectedItem[this.contentElement.attrForSelected] || label;
}
this._setValue(value);
- this._setSelectedItemLabel(value);
+ this._setSelectedItemLabel(label);
},
/**
diff --git a/test/paper-dropdown-menu.html b/test/paper-dropdown-menu.html
index a1630b6..8e19910 100644
--- a/test/paper-dropdown-menu.html
+++ b/test/paper-dropdown-menu.html
@@ -49,6 +49,28 @@
+
+
+
+