Skip to content

Commit

Permalink
Stringify undefined key
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Aug 9, 2021
1 parent e39d46c commit 1d23adc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const SHOULD_PROPAGATE = true;
* Stringify a keyboard event.
*/
export function keyboardEventCombo(e: KeyboardEvent) {
const keys = new Set<string>([e.key.toLocaleLowerCase()]);
const keys = new Set<string>([String(e.key).toLocaleLowerCase()]);

if (e.shiftKey) keys.add("shift");
if (e.ctrlKey) keys.add("control");
Expand Down

0 comments on commit 1d23adc

Please sign in to comment.