@syncfusion/ej2-schedule 28.1.33 → 28.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22029,14 +22029,14 @@ class DragAndDrop extends ActionBase {
22029
22029
  this.isPreventMultiDrag = false;
22030
22030
  this.slotsUptoCursor = -1;
22031
22031
  this.eleTop = 0;
22032
+ this.distanceUptoCursor = 0;
22032
22033
  }
22033
22034
  wireDragEvent(element) {
22034
- const isVerticalView = ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1;
22035
22035
  new Draggable(element, {
22036
22036
  abort: '.' + EVENT_RESIZE_CLASS,
22037
22037
  clone: true,
22038
22038
  isDragScroll: true,
22039
- enableTailMode: (this.parent.eventDragArea || isVerticalView) ? true : false,
22039
+ enableTailMode: this.parent.eventDragArea ? true : false,
22040
22040
  cursorAt: (this.parent.eventDragArea) ? { left: -20, top: -20 } : { left: 0, top: 0 },
22041
22041
  dragArea: this.dragArea,
22042
22042
  dragStart: this.dragStart.bind(this),
@@ -22059,8 +22059,12 @@ class DragAndDrop extends ActionBase {
22059
22059
  }
22060
22060
  this.setDragActionDefaultValues();
22061
22061
  this.actionObj.element = e.element;
22062
- this.eleTop = parseFloat(this.actionObj.element.style.top);
22063
- this.slotsUptoCursor = -1;
22062
+ if (e.sender && ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1) {
22063
+ const eventArgs = this.parent.eventBase.getPageCoordinates(e.sender);
22064
+ this.distanceUptoCursor = eventArgs.clientY - this.actionObj.element.getBoundingClientRect().top;
22065
+ this.eleTop = parseFloat(this.actionObj.element.style.top);
22066
+ this.slotsUptoCursor = -1;
22067
+ }
22064
22068
  this.actionObj.action = 'drag';
22065
22069
  let elements = [];
22066
22070
  if (!this.parent.allowMultiDrag || isNullOrUndefined(this.parent.selectedElements) || this.parent.selectedElements.length === 0 ||
@@ -22140,11 +22144,11 @@ class DragAndDrop extends ActionBase {
22140
22144
  let top = parseInt(e.top, 10);
22141
22145
  top = top < 0 ? 0 : top;
22142
22146
  if (this.slotsUptoCursor < 0) {
22143
- const cellsCountUptoCursor = Math.floor(top / cellHeight);
22147
+ const cellsCountUptoCursor = Math.floor((this.eleTop + this.distanceUptoCursor) / cellHeight);
22144
22148
  const cellsCountUptoEleTop = Math.floor(this.eleTop / cellHeight);
22145
22149
  this.slotsUptoCursor = cellsCountUptoCursor - cellsCountUptoEleTop;
22146
22150
  }
22147
- top = (Math.floor((top + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
22151
+ top = (Math.floor((top + this.distanceUptoCursor + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
22148
22152
  topValue = formatUnit(top < 0 ? 0 : top);
22149
22153
  const scrollHeight = this.parent.element.querySelector('.e-content-wrap').scrollHeight;
22150
22154
  const cloneBottom = parseInt(topValue, 10) + this.actionObj.clone.offsetHeight;