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

Unified 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, 2 months 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/iron-validatable-behavior/iron-validatable-behavior.html
diff --git a/lib/src/iron-validatable-behavior/iron-validatable-behavior.html b/lib/src/iron-validatable-behavior/iron-validatable-behavior.html
index e79047723cdb9978fd0aa9d8815b7a7e6fa6a134..8060713913cdd9cce1462cdaa1b9507290468d87 100644
--- a/lib/src/iron-validatable-behavior/iron-validatable-behavior.html
+++ b/lib/src/iron-validatable-behavior/iron-validatable-behavior.html
@@ -14,7 +14,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
/**
- * Use `Polymer.IronValidatableBehavior` to implement an element that validates user input.
+ * `Use Polymer.IronValidatableBehavior` to implement an element that validates user input.
+ * Use the related `Polymer.IronValidatorBehavior` to add custom validation logic to an iron-input.
+ *
+ * By default, an `<iron-form>` element validates its fields when the user presses the submit button.
+ * To validate a form imperatively, call the form's `validate()` method, which in turn will
+ * call `validate()` on all its children. By using `Polymer.IronValidatableBehavior`, your
+ * custom element will get a public `validate()`, which
+ * will return the validity of the element, and a corresponding `invalid` attribute,
+ * which can be used for styling.
+ *
+ * To implement the custom validation logic of your element, you must override
+ * the protected `_getValidity()` method of this behaviour, rather than `validate()`.
+ * See [this](https://github.com/PolymerElements/iron-form/blob/master/demo/simple-element.html)
+ * for an example.
*
* ### Accessibility
*
« 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