3 Polymer('core-input', {
8 * The "committed" value of the input, ie. the input value when the user
9 * hits the "enter" key or blurs the input after changing the value. You
10 * can bind to this value instead of listening for the "change" event.
11 * Setting this property has no effect on the input value.
13 * @attribute committedValue
20 * Set to true to prevent invalid input from being entered.
22 * @attribute preventInvalidInput
26 preventInvalidInput
: false
30 previousValidInput
: '',
34 change
: 'changeAction'
38 /* set ARIA attributes */
39 this.disabledHandler();
40 this.placeholderHandler();
43 attributeChanged: function(attr
, old
) {
44 if (this[attr
+ 'Handler']) {
45 this[attr
+ 'Handler'](old
);
49 disabledHandler: function() {
51 this.setAttribute('aria-disabled', '');
53 this.removeAttribute('aria-disabled');
57 placeholderHandler: function() {
58 if (this.placeholder
) {
59 this.setAttribute('aria-label', this.placeholder
);
61 this.removeAttribute('aria-label');
66 * Commits the `value` to `committedValue`
71 this.committedValue
= this.value
;
74 changeAction: function() {
78 inputAction: function(e
) {
79 if (this.preventInvalidInput
) {
80 if (!e
.target
.validity
.valid
) {
81 e
.target
.value
= this.previousValidInput
;
83 this.previousValidInput
= e
.target
.value
;