Browse Source

fix: Removed flickering for column dnd

pull/6810/head
Muhammed Mustafa 1 year ago
parent
commit
4d69c40d20
  1. 10
      packages/nc-gui/components/smartsheet/grid/useColumnDrag.ts

10
packages/nc-gui/components/smartsheet/grid/useColumnDrag.ts

@ -45,14 +45,20 @@ export const useColumnDrag = ({
draggedCol.value = fields.value.find((f) => f.id === colId) ?? null
dragColPlaceholderDomRef.value!.style.height = `${tableBodyEl.value?.getBoundingClientRect().height}px`
const x = e.clientX - leftSidebarWidth.value
if (x >= 0 && dragColPlaceholderDomRef.value) {
dragColPlaceholderDomRef.value.style.left = `${x.toString()}px`
}
}
const onDrag = (e: DragEvent) => {
e.preventDefault()
if (!e.dataTransfer) return
if (!draggedCol.value) return
e.preventDefault()
if (!dragColPlaceholderDomRef.value) return
if (e.clientX === 0) {

Loading…
Cancel
Save