From 4706144290fc4dc74bcff35017a2a0c6c6b84465 Mon Sep 17 00:00:00 2001 From: navedqb <109583873+navedqb@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:12:32 +0530 Subject: [PATCH] fix escape not working in dialog (#6719) --- components/lib/dialog/Dialog.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/lib/dialog/Dialog.js b/components/lib/dialog/Dialog.js index f8216b4387..6f35885e14 100644 --- a/components/lib/dialog/Dialog.js +++ b/components/lib/dialog/Dialog.js @@ -450,7 +450,11 @@ export const Dialog = React.forwardRef((inProps, ref) => { className: cx('closeButton'), 'aria-label': ariaLabel, onClick: onClose, - onKeyDown: (ev) => ev.stopPropagation() + onKeyDown: (ev) => { + if (ev.key !== 'Escape') { + ev.stopPropagation(); + } + } }, ptm('closeButton') );