Browse Source

fix: update dragOffset fixed

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

Loading…
Cancel
Save