Fix drag n drop selection issue [SCI-11846]

This commit is contained in:
Anton 2025-07-25 14:43:18 +02:00
parent 61c8435a63
commit f29b56ca27
3 changed files with 12 additions and 2 deletions

View file

@ -55,6 +55,9 @@
:inRepository="inRepository"
:draggable="checklistItems.length > 1"
:data-e2e="`${dataE2e}-checklistItem${element.id}`"
:class="{
'select-none': reordering
}"
@editStart="editingItem = true"
@editEnd="editingItem = false"
@update="saveItem"

View file

@ -17,12 +17,14 @@
:forceFallback="true"
:handle="'.element-grip'"
item-key="field"
@start="startReorder"
@end="endReorder"
>
<template #item="{element}">
<div
class="flex items-center gap-4 py-2.5 px-3 group/column"
:class="{
'select-none': reordering,
'hover:bg-sn-super-light-grey': element.field !== 'pinnedSeparator',
'!py-2.5': element.field === 'pinnedSeparator',
'text-sn-grey': (element.field !== 'pinnedSeparator' && !columnVisbile(element))
@ -77,7 +79,8 @@ export default {
data() {
return {
currentTableState: {},
columnsList: []
columnsList: [],
reordering: false
};
},
created() {
@ -142,7 +145,11 @@ export default {
...columns.slice(pinnedAmount - 1)
];
},
startReorder() {
this.reordering = true;
},
endReorder(event) {
this.reordering = false;
this.$nextTick(() => {
const { newIndex } = event;
const columnName = this.columnsList[newIndex].field;

View file

@ -9,7 +9,7 @@
<template v-if="isOpen">
<teleport to="body">
<div ref="flyout"
class="fixed z-[3000] sn-menu-dropdown bg-sn-white rounded p-2.5 sn-shadow-menu-sm flex flex-col gap-[1px]"
class="fixed z-[3000] sn-menu-dropdown max-h-96 overflow-y-auto bg-sn-white rounded p-2.5 sn-shadow-menu-sm flex flex-col gap-[1px]"
:class="{
'right-0': position === 'right',
'left-0': position === 'left',