From 9d488e1916f60ca03ccbff511f810753176d9023 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 8 Oct 2019 19:32:44 -0400 Subject: Validate that key is a string On Chrome, when clicking an autocomplete dropdown menu option, a keydown event is generated which is not of type KeyboardEvent. --- ext/mixed/js/display.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/mixed') diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 575011fd..228e554a 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -539,7 +539,7 @@ class Display { static getKeyFromEvent(event) { const key = event.key; - return key.length === 1 ? key.toUpperCase() : key; + return (typeof key === 'string' ? (key.length === 1 ? key.toUpperCase() : key) : ''); } } -- cgit v1.2.3