Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NcDialog): allow to close NcDialog on click outside #5062

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/NcAppSettingsDialog/NcAppSettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export default {
dialogProperties() {
return {
additionalTrapElements: this.additionalTrapElements,
closeOnClickOutside: true,
class: 'app-settings',
container: this.container,
contentClasses: 'app-settings__content',
Expand Down
11 changes: 10 additions & 1 deletion src/components/NcDialog/NcDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@ export default defineComponent({
default: true,
},

/**
* Close the dialog if the user clicked outside of the dialog
* Only relevant if `canClose` is set to true.
*/
closeOnClickOutside: {
type: Boolean,
default: false,
},

/**
* Declare if hiding the modal should be animated
* @default false
Expand Down Expand Up @@ -345,7 +354,7 @@ export default defineComponent({
show: props.open && showModal.value,
outTransition: props.outTransition,
class: 'dialog__modal',
closeOnClickOutside: false,
closeOnClickOutside: props.closeOnClickOutside,
enableSlideshow: false,
enableSwipe: false,
}))
Expand Down