Skip to content

Commit

Permalink
Merge pull request #5062 from nextcloud-libraries/fix/noid/click-outs…
Browse files Browse the repository at this point in the history
…ide-nc-dialog

fix(NcDialog): allow to close NcDialog on click outside
  • Loading branch information
Antreesy committed Jan 12, 2024
2 parents a02151b + 90e9326 commit fa70e03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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

0 comments on commit fa70e03

Please sign in to comment.