We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 83e0125 + 2200f86 commit c793f61Copy full SHA for c793f61
packages/kit-headless/src/components/modal/modal.tsx
@@ -89,6 +89,11 @@ export const Modal = component$((props: ModalProps) => {
89
data-state={showSig.value ? 'open' : 'closed'}
90
role={props.alert === true ? 'alertdialog' : 'dialog'}
91
ref={modalRefSig}
92
+ onKeyDown$={(event) => {
93
+ if (event.key === 'Escape') {
94
+ showSig.value = false;
95
+ }
96
+ }}
97
onClick$={(event) => closeOnBackdropClick$(event)}
98
>
99
<Slot />
0 commit comments