diff --git a/components/dashboard/src/components/ConfirmationModal.tsx b/components/dashboard/src/components/ConfirmationModal.tsx index e297c2b006ff55..000f849f31e43b 100644 --- a/components/dashboard/src/components/ConfirmationModal.tsx +++ b/components/dashboard/src/components/ConfirmationModal.tsx @@ -43,9 +43,10 @@ export default function ConfirmationModal(props: { child.push(props.children); } } + const cancelButtonRef = useRef(null); const buttons = [ - , + , , @@ -63,6 +64,10 @@ export default function ConfirmationModal(props: { visible={props.visible === undefined ? true : props.visible} onClose={props.onClose} onEnter={() => { + if (cancelButtonRef?.current?.contains(document.activeElement)) { + props.onClose(); + return false; + } if (buttonDisabled.current) { return false }