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

Unified Diff: ui/webui/resources/js/cr/ui/tree.js

Issue 2104103002: Convert Event#keyIdentifier (deprecated) to Event#key (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch file manager test Created 4 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
« no previous file with comments | « ui/webui/resources/js/cr/ui/tabs.js ('k') | ui/webui/resources/js/util.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/tree.js
diff --git a/ui/webui/resources/js/cr/ui/tree.js b/ui/webui/resources/js/cr/ui/tree.js
index 8f5ab0858cbbc4fb6514cec88fe1160f4cc8727a..aa9199e9c2dadd42a6aa61f2164e799bc15842ad 100644
--- a/ui/webui/resources/js/cr/ui/tree.js
+++ b/ui/webui/resources/js/cr/ui/tree.js
@@ -146,23 +146,22 @@ cr.define('cr.ui', function() {
var rtl = getComputedStyle(item).direction == 'rtl';
- switch (e.keyIdentifier) {
- case 'Up':
+ switch (e.key) {
+ case 'ArrowUp':
itemToSelect = item ? getPrevious(item) :
this.items[this.items.length - 1];
break;
- case 'Down':
+ case 'ArrowDown':
itemToSelect = item ? getNext(item) :
this.items[0];
break;
- case 'Left':
- case 'Right':
+ case 'ArrowLeft':
+ case 'ArrowRight':
// Don't let back/forward keyboard shortcuts be used.
if (!cr.isMac && e.altKey || cr.isMac && e.metaKey)
break;
- if (e.keyIdentifier == 'Left' && !rtl ||
- e.keyIdentifier == 'Right' && rtl) {
+ if (e.key == 'ArrowLeft' && !rtl || e.key == 'ArrowRight' && rtl) {
if (item.expanded)
item.expanded = false;
else
@@ -559,8 +558,8 @@ cr.define('cr.ui', function() {
// Calling tree.focus blurs the input which will make the tree item
// non editable.
- switch (e.keyIdentifier) {
- case 'U+001B': // Esc
+ switch (e.key) {
+ case 'Escape':
input.value = text;
// fall through
case 'Enter':
« no previous file with comments | « ui/webui/resources/js/cr/ui/tabs.js ('k') | ui/webui/resources/js/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698