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> |