@syncfusion/ej2-base 20.3.49 → 20.3.50

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.
@@ -7883,14 +7883,27 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
7883
7883
  }
7884
7884
  var draEleTop;
7885
7885
  var draEleLeft;
7886
- if (this.dragArea) {
7887
- this.dragLimit.top = this.clone ? this.dragLimit.top : 0;
7888
- draEleTop = (top - iTop) < 0 ? this.dragLimit.top : (top - this.borderWidth.top);
7889
- draEleLeft = (left - iLeft) < 0 ? this.dragLimit.left : (left - this.borderWidth.left);
7886
+ if (this.helperElement.classList.contains('e-treeview')) {
7887
+ if (this.dragArea) {
7888
+ this.dragLimit.top = this.clone ? this.dragLimit.top : 0;
7889
+ draEleTop = (top - iTop) < 0 ? this.dragLimit.top : (top - this.borderWidth.top);
7890
+ draEleLeft = (left - iLeft) < 0 ? this.dragLimit.left : (left - this.borderWidth.left);
7891
+ }
7892
+ else {
7893
+ draEleTop = top - this.borderWidth.top;
7894
+ draEleLeft = left - this.borderWidth.left;
7895
+ }
7890
7896
  }
7891
7897
  else {
7892
- draEleTop = top - this.borderWidth.top;
7893
- draEleLeft = left - this.borderWidth.left;
7898
+ if (this.dragArea) {
7899
+ this.dragLimit.top = this.clone ? this.dragLimit.top : 0;
7900
+ draEleTop = (top - iTop) < 0 ? this.dragLimit.top : (top - iTop);
7901
+ draEleLeft = (left - iLeft) < 0 ? this.dragElePosition.left : (left - iLeft);
7902
+ }
7903
+ else {
7904
+ draEleTop = top - iTop;
7905
+ draEleLeft = left - iLeft;
7906
+ }
7894
7907
  }
7895
7908
  var marginTop = parseFloat(getComputedStyle(this.element).marginTop);
7896
7909
  // when drag-element has margin-top
@@ -7923,7 +7936,7 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
7923
7936
  }
7924
7937
  }
7925
7938
  }
7926
- if (this.dragArea) {
7939
+ if (this.dragArea && this.helperElement.classList.contains('e-treeview')) {
7927
7940
  var helperHeight = helperElement.offsetHeight + (parseFloat(styles.marginTop)
7928
7941
  + parseFloat(styles.marginBottom));
7929
7942
  draEleTop = (draEleTop + helperHeight) > this.dragLimit.bottom ? (this.dragLimit.bottom - helperHeight) : draEleTop;
@@ -7997,7 +8010,7 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
7997
8010
  }
7998
8011
  }
7999
8012
  else if (nodeEle && nodeEle !== document.scrollingElement) {
8000
- if ((nodeEle.clientHeight + nodeEle.getBoundingClientRect().top - this.helperElement.clientHeight + document.scrollingElement.scrollTop - this.borderWidth.top - this.borderWidth.bottom) <= draEleTop) {
8013
+ if ((nodeEle.clientHeight + nodeEle.getBoundingClientRect().top - this.helperElement.clientHeight + document.scrollingElement.scrollTop) < draEleTop) {
8001
8014
  nodeEle.scrollTop += this.helperElement.clientHeight;
8002
8015
  }
8003
8016
  else if (nodeEle.getBoundingClientRect().top > (draEleTop - this.helperElement.clientHeight - document.scrollingElement.scrollTop)) {
@@ -8103,7 +8116,7 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
8103
8116
  if (ele) {
8104
8117
  var elementArea = ele.getBoundingClientRect();
8105
8118
  eleWidthBound = ele.scrollWidth ? ele.scrollWidth : elementArea.right - elementArea.left;
8106
- eleHeightBound = ele.scrollHeight ? (this.dragArea && this.helperElement.classList.contains('e-treeview')) ? ele.clientHeight : ele.scrollHeight : elementArea.bottom - elementArea.top;
8119
+ eleHeightBound = ele.scrollHeight ? (this.dragArea && !isNullOrUndefined(this.helperElement) && this.helperElement.classList.contains('e-treeview')) ? ele.clientHeight : ele.scrollHeight : elementArea.bottom - elementArea.top;
8107
8120
  var keys = ['Top', 'Left', 'Bottom', 'Right'];
8108
8121
  var styles = getComputedStyle(ele);
8109
8122
  for (var i = 0; i < keys.length; i++) {
@@ -8114,7 +8127,12 @@ var Draggable = /** @__PURE__ @class */ (function (_super) {
8114
8127
  this.borderWidth[lowerKey] = isNaN(parseFloat(tborder)) ? 0 : parseFloat(tborder);
8115
8128
  this.padding[lowerKey] = isNaN(parseFloat(tpadding)) ? 0 : parseFloat(tpadding);
8116
8129
  }
8117
- top = elementArea.top + document.scrollingElement.scrollTop;
8130
+ if (this.dragArea && !isNullOrUndefined(this.helperElement) && this.helperElement.classList.contains('e-treeview')) {
8131
+ top = elementArea.top + document.scrollingElement.scrollTop;
8132
+ }
8133
+ else {
8134
+ top = elementArea.top;
8135
+ }
8118
8136
  left = elementArea.left;
8119
8137
  this.dragLimit.left = left + this.borderWidth.left + this.padding.left;
8120
8138
  this.dragLimit.top = ele.offsetTop + this.borderWidth.top + this.padding.top;