Close toast when action is clicked
This commit is contained in:
parent
1b1ed2cd05
commit
dc5a17e962
1 changed files with 2 additions and 0 deletions
|
@ -91,12 +91,14 @@ export const Toast = memo(
|
|||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
toastAction.onClick();
|
||||
onClose();
|
||||
}}
|
||||
onKeyDown={(ev: KeyboardEvent<HTMLDivElement>) => {
|
||||
if (ev.key === 'Enter' || ev.key === ' ') {
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
toastAction.onClick();
|
||||
onClose();
|
||||
}
|
||||
}}
|
||||
ref={focusRef}
|
||||
|
|
Loading…
Reference in a new issue