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.
This commit is contained in:
parent
176f6a248b
commit
9d488e1916
@ -539,7 +539,7 @@ class Display {
|
|||||||
|
|
||||||
static getKeyFromEvent(event) {
|
static getKeyFromEvent(event) {
|
||||||
const key = event.key;
|
const key = event.key;
|
||||||
return key.length === 1 ? key.toUpperCase() : key;
|
return (typeof key === 'string' ? (key.length === 1 ? key.toUpperCase() : key) : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user