@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.
@@ -22834,15 +22834,15 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22834
22834
  _this.isPreventMultiDrag = false;
22835
22835
  _this.slotsUptoCursor = -1;
22836
22836
  _this.eleTop = 0;
22837
+ _this.distanceUptoCursor = 0;
22837
22838
  return _this;
22838
22839
  }
22839
22840
  DragAndDrop.prototype.wireDragEvent = function (element) {
22840
- var isVerticalView = ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1;
22841
22841
  new Draggable(element, {
22842
22842
  abort: '.' + EVENT_RESIZE_CLASS,
22843
22843
  clone: true,
22844
22844
  isDragScroll: true,
22845
- enableTailMode: (this.parent.eventDragArea || isVerticalView) ? true : false,
22845
+ enableTailMode: this.parent.eventDragArea ? true : false,
22846
22846
  cursorAt: (this.parent.eventDragArea) ? { left: -20, top: -20 } : { left: 0, top: 0 },
22847
22847
  dragArea: this.dragArea,
22848
22848
  dragStart: this.dragStart.bind(this),
@@ -22866,8 +22866,12 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22866
22866
  }
22867
22867
  this.setDragActionDefaultValues();
22868
22868
  this.actionObj.element = e.element;
22869
- this.eleTop = parseFloat(this.actionObj.element.style.top);
22870
- this.slotsUptoCursor = -1;
22869
+ if (e.sender && ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1) {
22870
+ var eventArgs = this.parent.eventBase.getPageCoordinates(e.sender);
22871
+ this.distanceUptoCursor = eventArgs.clientY - this.actionObj.element.getBoundingClientRect().top;
22872
+ this.eleTop = parseFloat(this.actionObj.element.style.top);
22873
+ this.slotsUptoCursor = -1;
22874
+ }
22871
22875
  this.actionObj.action = 'drag';
22872
22876
  var elements = [];
22873
22877
  if (!this.parent.allowMultiDrag || isNullOrUndefined(this.parent.selectedElements) || this.parent.selectedElements.length === 0 ||
@@ -22947,11 +22951,11 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
22947
22951
  var top_1 = parseInt(e.top, 10);
22948
22952
  top_1 = top_1 < 0 ? 0 : top_1;
22949
22953
  if (this.slotsUptoCursor < 0) {
22950
- var cellsCountUptoCursor = Math.floor(top_1 / cellHeight);
22954
+ var cellsCountUptoCursor = Math.floor((this.eleTop + this.distanceUptoCursor) / cellHeight);
22951
22955
  var cellsCountUptoEleTop = Math.floor(this.eleTop / cellHeight);
22952
22956
  this.slotsUptoCursor = cellsCountUptoCursor - cellsCountUptoEleTop;
22953
22957
  }
22954
- top_1 = (Math.floor((top_1 + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
22958
+ top_1 = (Math.floor((top_1 + this.distanceUptoCursor + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
22955
22959
  topValue = formatUnit(top_1 < 0 ? 0 : top_1);
22956
22960
  var scrollHeight = this.parent.element.querySelector('.e-content-wrap').scrollHeight;
22957
22961
  var cloneBottom = parseInt(topValue, 10) + this.actionObj.clone.offsetHeight;