Skip to content

Commit 65c91f7

Browse files
committed
fix(pf4): handle escape key in modal wizard
1 parent aa8a0ab commit 65c91f7

File tree

1 file changed

+7
-1
lines changed
  • packages/pf4-component-mapper/src/files

1 file changed

+7
-1
lines changed

packages/pf4-component-mapper/src/files/wizard.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ const WizardInternal = ({
9292
className={`pf-c-wizard ${inModal ? '' : 'no-shadow'} ddorg__pf4-component-mapper__wizard ${className ? className : ''}`}
9393
role="dialog"
9494
aria-modal={inModal ? 'true' : undefined}
95-
onKeyDown={onKeyDown}
95+
onKeyDown={(e) => {
96+
onKeyDown(e);
97+
98+
if (e.key === 'Escape' && inModal) {
99+
formOptions.onCancel();
100+
}
101+
}}
96102
{...rest}
97103
>
98104
{title && (

0 commit comments

Comments
 (0)