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

Unified Diff: third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html

Issue 1221923003: Update bower.json for Polymer elements and add PRESUBMIT.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 5 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
Index: third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html
diff --git a/third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html b/third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html
index 1e72e983eb2772356768528121a84b556ca5cadf..685d10a43e5f207082256bb7486c382311e6cde9 100644
--- a/third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html
+++ b/third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html
@@ -8,6 +8,7 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
+<link rel="import" href="../iron-behaviors/iron-control-state.html">
<script>
@@ -19,9 +20,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
*
* The input element can be accessed by the `inputElement` property if you need to access
* properties or methods that are not exposed.
- * @polymerBehavior
+ * @polymerBehavior Polymer.PaperInputBehavior
*/
- Polymer.PaperInputBehavior = {
+ Polymer.PaperInputBehaviorImpl = {
properties: {
@@ -84,6 +85,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
+ * The datalist of the input (if any). This should match the id of an existing <datalist>. Bind this
+ * to the `<input is="iron-input">`'s `list` property.
+ */
+ list: {
+ type: String
+ },
+
+ /**
* A pattern to validate the `input` with. Bind this to the `<input is="iron-input">`'s
* `pattern` property.
*/
@@ -221,6 +230,24 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
type: Number
},
+ // Nonstandard attributes for binding if needed
+
+ /**
+ * Bind this to the `<input is="iron-input">`'s `autocapitalize` property.
+ */
+ autocapitalize: {
+ type: String,
+ value: 'none'
+ },
+
+ /**
+ * Bind this to the `<input is="iron-input">`'s `autocorrect` property.
+ */
+ autocorrect: {
+ type: String,
+ value: 'off'
+ },
+
_ariaDescribedBy: {
type: String,
value: ''
@@ -232,6 +259,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
'addon-attached': '_onAddonAttached'
},
+ observers: [
+ '_focusedControlStateChanged(focused)'
+ ],
+
/**
* Returns a reference to the input element.
*/
@@ -296,6 +327,24 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
return placeholder || alwaysFloatLabel;
},
+ _focusedControlStateChanged: function(focused) {
+ // IronControlState stops the focus and blur events in order to redispatch them on the host
+ // element, but paper-input-container listens to those events. Since there are more
+ // pending work on focus/blur in IronControlState, I'm putting in this hack to get the
+ // input focus state working for now.
+ if (!this.$.container) {
+ this.$.container = Polymer.dom(this.root).querySelector('paper-input-container');
+ if (!this.$.container) {
+ return;
+ }
+ }
+ if (focused) {
+ this.$.container._onFocus();
+ } else {
+ this.$.container._onBlur();
+ }
+ },
+
_updateAriaLabelledBy: function() {
var label = Polymer.dom(this.root).querySelector('label');
if (!label) {
@@ -314,4 +363,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
};
+ /** @polymerBehavior */
+ Polymer.PaperInputBehavior = [Polymer.IronControlState, Polymer.PaperInputBehaviorImpl];
+
</script>

Powered by Google App Engine
This is Rietveld 408576698