Skip to content

Commit

Permalink
Merge pull request #62 from swup/feat/handle-dialog-escape
Browse files Browse the repository at this point in the history
  • Loading branch information
hirasso authored Nov 13, 2023
2 parents 30a9022 + f71146e commit c75d8f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/inc/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function showDialogs({ logger }: FragmentPlugin): void {
el.__swupFragment.modalShown = true;
el.removeAttribute('open');
el.showModal?.();
el.addEventListener('keydown', (e) => e.key === 'Escape' && e.preventDefault());
});
}

Expand Down

0 comments on commit c75d8f5

Please sign in to comment.