From dc5a17e962e3ccc40adb4fa4044ec29dce4c62e3 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Thu, 21 Oct 2021 16:14:26 -0400 Subject: [PATCH] Close toast when action is clicked --- ts/components/Toast.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ts/components/Toast.tsx b/ts/components/Toast.tsx index f33fdd3a75..c2133e32fa 100644 --- a/ts/components/Toast.tsx +++ b/ts/components/Toast.tsx @@ -91,12 +91,14 @@ export const Toast = memo( ev.stopPropagation(); ev.preventDefault(); toastAction.onClick(); + onClose(); }} onKeyDown={(ev: KeyboardEvent) => { if (ev.key === 'Enter' || ev.key === ' ') { ev.stopPropagation(); ev.preventDefault(); toastAction.onClick(); + onClose(); } }} ref={focusRef}