Skip to content

Commit

Permalink
fix(Modal/Slideover): prevent esc with prevent-close prop
Browse files Browse the repository at this point in the history
Resolves #2501
  • Loading branch information
benjamincanac committed Nov 10, 2024
1 parent ea97759 commit 9e2cc5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/runtime/components/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ const contentEvents = computed(() => {
if (props.preventClose) {
return {
pointerDownOutside: (e: Event) => e.preventDefault(),
interactOutside: (e: Event) => e.preventDefault()
interactOutside: (e: Event) => e.preventDefault(),
escapeKeyDown: (e: Event) => e.preventDefault()
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/components/Slideover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ const contentEvents = computed(() => {
if (props.preventClose) {
return {
pointerDownOutside: (e: Event) => e.preventDefault(),
interactOutside: (e: Event) => e.preventDefault()
interactOutside: (e: Event) => e.preventDefault(),
escapeKeyDown: (e: Event) => e.preventDefault()
}
}
Expand Down

0 comments on commit 9e2cc5b

Please sign in to comment.