Skip to content

Commit 5e527ff

Browse files
committed
added property errors for polylint
1 parent 28a4e96 commit 5e527ff

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

paper-input.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,34 @@
177177
Polymer.PaperInputBehavior
178178
],
179179

180+
properties: {
181+
/*
182+
* Errors that are exposed by validatable element.
183+
* The error with the highest priority in this list will be shown when validatable is in error state, and no error-message is supplied.
184+
*/
185+
errors: {
186+
type: Array,
187+
value: function () {
188+
return [];
189+
}
190+
}
191+
},
192+
180193
/**
181194
* Makes sure only error messages with the highest priority are shown.
182195
* @param {Object} item The error object to be filtered out.
183-
* @return {boolean} True if `value` has the highest priority.
196+
* @return {boolean} whether the item should be shown based on priority
184197
*/
185198
_showHighestPrio: function (item) {
186199
return item.priority < 1;
187200
},
188201

202+
/**
203+
* Determines whether error with highest priority from errors array needs to be shown.
204+
* This error will be visible when property error-message is not supplied and the errors array is not empty.
205+
* @param {Array} errors array
206+
* @return {boolean} whether error with highest priority from errors array will be shown.
207+
*/
189208
_showErrors: function(errors) {
190209
return !this.errorMessage && errors;
191210
}

0 commit comments

Comments
 (0)