diff --git a/resources/js/views/gallery-panels/Albums.vue b/resources/js/views/gallery-panels/Albums.vue index fec5a3928c3..570905fa564 100644 --- a/resources/js/views/gallery-panels/Albums.vue +++ b/resources/js/views/gallery-panels/Albums.vue @@ -235,9 +235,13 @@ onKeyStroke("k", () => !shouldIgnoreKeystroke() && user.value?.id === null && (i const { onPaste, dragEnd, dropUpload } = useMouseEvents(rootRights, is_upload_visible, list_upload_files); -window.addEventListener("paste", onPaste); -window.addEventListener("dragover", dragEnd); -window.addEventListener("drop", dropUpload); +onMounted(() => { + window.addEventListener("paste", onPaste); + window.addEventListener("dragover", dragEnd); + window.addEventListener("drop", dropUpload); + togglableStore.left_menu_open = false; +}); + router.afterEach(() => { window.removeEventListener("paste", onPaste); window.removeEventListener("dragover", dragEnd);