Index: chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js |
diff --git a/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js b/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js |
index 90cf289bcb905ff3771653ffc354009b882d6b1f..d8b2762fb104855a57eb10cc72b4413c231f46ea 100644 |
--- a/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js |
+++ b/chrome/browser/resources/chromeos/quick_unlock/pin_keyboard.js |
@@ -93,6 +93,17 @@ Polymer({ |
}, |
/** |
+ * @override |
+ */ |
+ attached: function() { |
+ // Remove the space/enter key binds from the polymer |
+ // iron-a11y-keys-behavior. |
+ var digitButtons = Polymer.dom(this.root).querySelectorAll('.digit-button'); |
+ for (var i = 0; i < digitButtons.length; ++i) |
+ digitButtons[i].keyEventTarget = null; |
+ }, |
+ |
+ /** |
* Gets the container holding the password field. |
* @type {!HTMLInputElement} |
*/ |
@@ -209,7 +220,7 @@ Polymer({ |
/** |
* Keypress does not handle backspace but handles the char codes nicely, so we |
* have a seperate event to process the backspaces. |
- * @param {Event} event Keypress Event object. |
+ * @param {Event} event Keydown Event object. |
* @private |
*/ |
onKeyDown_: function(event) { |
@@ -243,6 +254,21 @@ Polymer({ |
return; |
} |
+ // Space pressed. We want the old polymer function of space activating the |
+ // button with focus. |
+ if (code == 32) { |
+ // Check if target was a number button. |
+ if (event.target.hasAttribute('value')) { |
+ this.value += event.target.getAttribute('value'); |
+ return; |
+ } |
+ // Check if target was backspace button. |
+ if (event.target.classList.contains('backspace-button')) { |
+ this.onPinClear_(); |
+ return; |
+ } |
+ } |
+ |
this.value += String.fromCharCode(code); |
}, |