Skip to content

Commit 37ea36c

Browse files
authored
Fix modal closing on Escape key when closeable is false (#1510)
1 parent 121122c commit 37ea36c

File tree

1 file changed

+6
-2
lines changed
  • stubs/inertia/resources/js/Components

1 file changed

+6
-2
lines changed

stubs/inertia/resources/js/Components/Modal.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ const close = () => {
4141
};
4242
4343
const closeOnEscape = (e) => {
44-
if (e.key === 'Escape' && props.show) {
45-
close();
44+
if (e.key === 'Escape') {
45+
e.preventDefault();
46+
47+
if (props.show) {
48+
close();
49+
}
4650
}
4751
};
4852

0 commit comments

Comments
 (0)