Skip to content

Commit

Permalink
Fix modal closing on Escape key when closeable is false (#1510)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChazyTheBest committed Jul 9, 2024
1 parent 121122c commit 37ea36c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions stubs/inertia/resources/js/Components/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ const close = () => {
};
const closeOnEscape = (e) => {
if (e.key === 'Escape' && props.show) {
close();
if (e.key === 'Escape') {
e.preventDefault();
if (props.show) {
close();
}
}
};
Expand Down

0 comments on commit 37ea36c

Please sign in to comment.