From 43d32f0ec5f122d7cf4ffbfde15c1a26b174065b Mon Sep 17 00:00:00 2001 From: niyap <38278268+niyap@users.noreply.github.com> Date: Thu, 1 Feb 2024 11:34:13 +0200 Subject: [PATCH] fix(ui5-toast): check whether the event key property exists (#8209) Co-authored-by: Nia Peeva --- packages/main/src/Toast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/main/src/Toast.ts b/packages/main/src/Toast.ts index 7da2bdac76ac..ab265f927f47 100644 --- a/packages/main/src/Toast.ts +++ b/packages/main/src/Toast.ts @@ -23,7 +23,7 @@ let opener: HTMLElement | null; let globalListenerAdded = false; const handleGlobalKeydown = (e: KeyboardEvent) => { const isCtrl = e.metaKey || (!isMac() && e.ctrlKey); - const isMKey = e.key.toLowerCase() === "m"; + const isMKey = e.key && e.key.toLowerCase() === "m"; const isCombinationPressed = isCtrl && e.shiftKey && isMKey; const hasOpenToast = openedToasts.length;