Skip to content

Commit

Permalink
Merge pull request #1113 from nextcloud-libraries/fix/file-picker-doe…
Browse files Browse the repository at this point in the history
…s-not-close

fix(FilePicker): Listen on `update:open` rather than `closed` event from `NcDialog`
  • Loading branch information
susnux committed Nov 17, 2023
2 parents 46041f5 + 66a786b commit a71cf49
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 11 additions & 1 deletion lib/components/FilePicker/FilePicker.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<NcDialog v-bind="dialogProps" @close="emit('close')">
<NcDialog v-bind="dialogProps" @update:open="handleClose">
<template #navigation="{ isCollapsed }">
<FilePickerNavigation :is-collapsed="isCollapsed" :current-view.sync="currentView" :filter-string.sync="filterString" />
</template>
Expand Down Expand Up @@ -266,6 +266,16 @@ const onCreateFolder = async (name: string) => {
showError(t('Could not create the new folder'))
}
}
/**
* Handle closing the file picker
* @param open If the dialog is open
*/
const handleClose = (open: boolean) => {
if (!open) {
emit('close')
}
}
</script>

<script lang="ts">
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"dist"
],
"peerDependencies": {
"@nextcloud/vue": "^8.0.0",
"@nextcloud/vue": "^8.1.0",
"vue": "^2.7.15"
},
"dependencies": {
Expand Down

0 comments on commit a71cf49

Please sign in to comment.