Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions paper-dropdown-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
Applications can listen for the `iron-select` and `iron-deselect` events
to react when options are selected and deselected.

### Validation

If the `auto-validate` attribute is set, the element will be validated when
the selected item changes.

### Styling

The following custom properties and mixins are also available for styling:
Expand Down Expand Up @@ -135,6 +140,14 @@
],

properties: {

/**
* Set to true to auto-validate the input value when it changes.
*/
autoValidate: {
type: Boolean
},

/**
* The derived "label" of the currently selected item. This value
* is the `label` property on the selected item if set, or else the
Expand Down Expand Up @@ -365,6 +378,16 @@

this._setValue(value);
this._setSelectedItemLabel(value);

if( this.autoValidate ){
var valid;
if (this.validate) {
valid = this.validate();
} else {
valid = this.checkValidity();
}
this.invalid = !valid;
}
},

/**
Expand Down