Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: lib/src/iron-validatable-behavior/iron-validatable-behavior.html

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 @license 2 @license
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt 4 This code may only be used under the BSD style license found at http://polymer.g ithub.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI BUTORS.txt
7 Code distributed by Google as part of the polymer project is also 7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN TS.txt
9 --> 9 -->
10 10
11 <link rel="import" href="../polymer/polymer.html"> 11 <link rel="import" href="../polymer/polymer.html">
12 <link rel="import" href="../iron-meta/iron-meta.html"> 12 <link rel="import" href="../iron-meta/iron-meta.html">
13 13
14 <script> 14 <script>
15 15
16 /** 16 /**
17 * Use `Polymer.IronValidatableBehavior` to implement an element that validate s user input. 17 * `Use Polymer.IronValidatableBehavior` to implement an element that validate s user input.
18 * Use the related `Polymer.IronValidatorBehavior` to add custom validation lo gic to an iron-input.
19 *
20 * By default, an `<iron-form>` element validates its fields when the user pre sses the submit button.
21 * To validate a form imperatively, call the form's `validate()` method, which in turn will
22 * call `validate()` on all its children. By using `Polymer.IronValidatableBeh avior`, your
23 * custom element will get a public `validate()`, which
24 * will return the validity of the element, and a corresponding `invalid` attr ibute,
25 * which can be used for styling.
26 *
27 * To implement the custom validation logic of your element, you must override
28 * the protected `_getValidity()` method of this behaviour, rather than `valid ate()`.
29 * See [this](https://github.com/PolymerElements/iron-form/blob/master/demo/si mple-element.html)
30 * for an example.
18 * 31 *
19 * ### Accessibility 32 * ### Accessibility
20 * 33 *
21 * Changing the `invalid` property, either manually or by calling `validate()` will update the 34 * Changing the `invalid` property, either manually or by calling `validate()` will update the
22 * `aria-invalid` attribute. 35 * `aria-invalid` attribute.
23 * 36 *
24 * @demo demo/index.html 37 * @demo demo/index.html
25 * @polymerBehavior 38 * @polymerBehavior
26 */ 39 */
27 Polymer.IronValidatableBehavior = { 40 Polymer.IronValidatableBehavior = {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 125
113 _getValidity: function(value) { 126 _getValidity: function(value) {
114 if (this.hasValidator()) { 127 if (this.hasValidator()) {
115 return this._validator.validate(value); 128 return this._validator.validate(value);
116 } 129 }
117 return true; 130 return true;
118 } 131 }
119 }; 132 };
120 133
121 </script> 134 </script>
OLDNEW
« no previous file with comments | « lib/src/iron-test-helpers/mock-interactions.js ('k') | lib/src/neon-animation/neon-animated-pages.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698