diff --git a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue index edf8135211a..c6f686c6440 100644 --- a/packages/web-app-files/src/components/FilesList/KeyboardActions.vue +++ b/packages/web-app-files/src/components/FilesList/KeyboardActions.vue @@ -167,7 +167,7 @@ export default defineComponent({ scrollToResource({ id: nextResourceId } as any) selectionCursor.value = unref(selectionCursor) + 1 } - const handleShiftClickAction = (resource) => { + const handleShiftClickAction = ({ resource, skipTargetSelection }) => { const parent = document.querySelectorAll(`[data-item-id='${resource.id}']`)[0] const resourceNodes = Object.values(parent.parentNode.children) const latestNode = resourceNodes.find( @@ -184,6 +184,9 @@ export default defineComponent({ for (let i = minIndex; i <= maxIndex; i++) { const nodeId = resourceNodes[i].getAttribute('data-item-id') + if (skipTargetSelection && nodeId === resource.id) { + continue + } store.commit('Files/ADD_FILE_SELECTION', { id: nodeId }) } store.commit('Files/SET_LATEST_SELECTED_FILE_ID', resource.id) diff --git a/packages/web-app-files/src/components/FilesList/ResourceTable.vue b/packages/web-app-files/src/components/FilesList/ResourceTable.vue index 23e457923b2..44cce0becca 100644 --- a/packages/web-app-files/src/components/FilesList/ResourceTable.vue +++ b/packages/web-app-files/src/components/FilesList/ResourceTable.vue @@ -47,7 +47,7 @@ :model-value="isResourceSelected(item)" :outline="isLatestSelectedItem(item)" @update:model-value="setSelection($event, item)" - @click.stop="fileClicked([item, $event])" + @click.stop="fileClicked([item, $event, true])" />