Skip to content

Commit c75d8f5

Browse files
authored
Merge pull request #62 from swup/feat/handle-dialog-escape
2 parents 30a9022 + f71146e commit c75d8f5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/inc/functions.ts

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function showDialogs({ logger }: FragmentPlugin): void {
3333
el.__swupFragment.modalShown = true;
3434
el.removeAttribute('open');
3535
el.showModal?.();
36+
el.addEventListener('keydown', (e) => e.key === 'Escape' && e.preventDefault());
3637
});
3738
}
3839

0 commit comments

Comments
 (0)