Browse Source

fix: update dragOffset fixed

pull/9901/head
DarkPhoenix2704 4 days ago
parent
commit
e31ad4a663
  1. 16
      packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue

16
packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue

@ -416,6 +416,11 @@ const dragStart = (event: MouseEvent, record: Row) => {
isDragging.value = false
dragOffset.value = {
x: event.clientX - target.getBoundingClientRect().left,
y: event.clientY - target.getBoundingClientRect().top,
}
dragTimeout.value = setTimeout(() => {
if (!isUIAllowed('dataEdit')) return
isDragging.value = true
@ -423,11 +428,6 @@ const dragStart = (event: MouseEvent, record: Row) => {
target = target.parentElement as HTMLElement
}
dragOffset.value = {
x: event.clientX - target.getBoundingClientRect().left,
y: event.clientY - target.getBoundingClientRect().top,
}
const allRecords = document.querySelectorAll('.draggable-record')
allRecords.forEach((el) => {
if (!el.getAttribute('data-unique-id').includes(record.rowMeta.id!)) {
@ -445,6 +445,12 @@ const dragStart = (event: MouseEvent, record: Row) => {
const onMouseUp = () => {
clearTimeout(dragTimeout.value!)
dragOffset.value = {
x: null,
y: null,
}
document.removeEventListener('mouseup', onMouseUp)
if (!isDragging.value) {
emits('expandRecord', record)

Loading…
Cancel
Save