Skip to content

Commit

Permalink
Bugfix: Dragging a file causes no selection (#7473)
Browse files Browse the repository at this point in the history
* Fix drag & drop without selection

* Add changelog
  • Loading branch information
lookacat authored Aug 17, 2022
1 parent 168c840 commit 02b9687
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/bugfix-drag-drop-no-selection
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Dragging a file causes no selection

We've fixed a bug that caused no selection when dragging a file.

https://github.com/owncloud/web/pull/7473
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ export default defineComponent({
},
methods: {
...mapActions('Files/sidebar', ['openWithPanel']),
...mapActions('Files', ['toggleFileSelection']),
isResourceSelected(item) {
return this.selectedIds.includes(item.id)
},
Expand Down Expand Up @@ -637,11 +638,8 @@ export default defineComponent({
},
addSelectedResource(file) {
const isSelected = this.isResourceSelected(file)
if (isSelected) {
this.$emit('select', this.selectedIds)
} else {
this.$emit('select', this.selectedIds.concat([file]))
}
if (isSelected) return
this.toggleFileSelection(file)
},
resetDropPosition(id, event, item) {
const instance = this.$refs[id].tippy
Expand Down

0 comments on commit 02b9687

Please sign in to comment.