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

Unified Diff: ui/login/bubble.js

Issue 2104103002: Convert Event#keyIdentifier (deprecated) to Event#key (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 4 years, 6 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: ui/login/bubble.js
diff --git a/ui/login/bubble.js b/ui/login/bubble.js
index e31125a453b69a632b14dea1d18b81544131cc12..125cc97af6f7b17d6371d18e92c5e9884f9beac3 100644
--- a/ui/login/bubble.js
+++ b/ui/login/bubble.js
@@ -20,10 +20,10 @@ cr.define('cr.ui', function() {
* @enum {number}
*/
var KeyCodes = {
Dan Beam 2016/06/29 23:34:17 nit: KeyCodes => Keys
dtapuska 2016/06/30 14:16:50 Done.
- TAB: 'U+0009',
+ TAB: 'Tab',
ENTER: 'Enter',
- ESC: 'U+001B',
- SPACE: 'U+0020'
+ ESC: 'Escape',
+ SPACE: ' '
};
/**
@@ -327,20 +327,20 @@ cr.define('cr.ui', function() {
}
// Artificial tab-cycle.
- if (e.keyIdentifier == KeyCodes.TAB && e.shiftKey == true &&
+ if (e.key == KeyCodes.TAB && e.shiftKey == true &&
e.target == this.firstBubbleElement_) {
this.lastBubbleElement_.focus();
e.preventDefault();
}
- if (e.keyIdentifier == KeyCodes.TAB && e.shiftKey == false &&
+ if (e.key == KeyCodes.TAB && e.shiftKey == false &&
e.target == this.lastBubbleElement_) {
this.firstBubbleElement_.focus();
e.preventDefault();
}
// Close bubble on ESC or on hitting spacebar or Enter at close-button.
- if (e.keyIdentifier == KeyCodes.ESC ||
- ((e.keyIdentifier == KeyCodes.ENTER ||
- e.keyIdentifier == KeyCodes.SPACE) &&
+ if (e.key == KeyCodes.ESC ||
+ ((e.key == KeyCodes.ENTER ||
+ e.key == KeyCodes.SPACE) &&
e.target && e.target.classList.contains('close-button')))
this.hide();
},

Powered by Google App Engine
This is Rietveld 408576698