From 6a96a115493d4f1ff89d08466437085ec1cb5d13 Mon Sep 17 00:00:00 2001 From: Carl Saldanha Date: Fri, 21 Jul 2017 11:58:17 -0700 Subject: [PATCH] Events: Fix auto-filling issue on Chrome Closes #1358, closes #1365 --- src/event/Key.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/event/Key.js b/src/event/Key.js index 6b7b0d85..c8746429 100644 --- a/src/event/Key.js +++ b/src/event/Key.js @@ -81,8 +81,9 @@ var Key = new function() { // Use short version for arrow keys: ArrowLeft -> Left : /^Arrow[A-Z]/.test(key) ? key.substr(5) // This is far from ideal, but what else can we do? - : key === 'Unidentified' ? String.fromCharCode(event.keyCode) - : key; + : key === 'Unidentified' || key === undefined + ? String.fromCharCode(event.keyCode) + : key; return keyLookup[key] || // Hyphenate camel-cased special keys, lower-case normal ones: (key.length > 1 ? Base.hyphenate(key) : key.toLowerCase());