@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.
@@ -7654,14 +7654,27 @@ let Draggable = Draggable_1 = class Draggable extends Base {
7654
7654
  }
7655
7655
  let draEleTop;
7656
7656
  let draEleLeft;
7657
- if (this.dragArea) {
7658
- this.dragLimit.top = this.clone ? this.dragLimit.top : 0;
7659
- draEleTop = (top - iTop) < 0 ? this.dragLimit.top : (top - this.borderWidth.top);
7660
- draEleLeft = (left - iLeft) < 0 ? this.dragLimit.left : (left - this.borderWidth.left);
7657
+ if (this.helperElement.classList.contains('e-treeview')) {
7658
+ if (this.dragArea) {
7659
+ this.dragLimit.top = this.clone ? this.dragLimit.top : 0;
7660
+ draEleTop = (top - iTop) < 0 ? this.dragLimit.top : (top - this.borderWidth.top);
7661
+ draEleLeft = (left - iLeft) < 0 ? this.dragLimit.left : (left - this.borderWidth.left);
7662
+ }
7663
+ else {
7664
+ draEleTop = top - this.borderWidth.top;
7665
+ draEleLeft = left - this.borderWidth.left;
7666
+ }
7661
7667
  }
7662
7668
  else {
7663
- draEleTop = top - this.borderWidth.top;
7664
- draEleLeft = left - this.borderWidth.left;
7669
+ if (this.dragArea) {
7670
+ this.dragLimit.top = this.clone ? this.dragLimit.top : 0;
7671
+ draEleTop = (top - iTop) < 0 ? this.dragLimit.top : (top - iTop);
7672
+ draEleLeft = (left - iLeft) < 0 ? this.dragElePosition.left : (left - iLeft);
7673
+ }
7674
+ else {
7675
+ draEleTop = top - iTop;
7676
+ draEleLeft = left - iLeft;
7677
+ }
7665
7678
  }
7666
7679
  let marginTop = parseFloat(getComputedStyle(this.element).marginTop);
7667
7680
  // when drag-element has margin-top
@@ -7694,7 +7707,7 @@ let Draggable = Draggable_1 = class Draggable extends Base {
7694
7707
  }
7695
7708
  }
7696
7709
  }
7697
- if (this.dragArea) {
7710
+ if (this.dragArea && this.helperElement.classList.contains('e-treeview')) {
7698
7711
  let helperHeight = helperElement.offsetHeight + (parseFloat(styles.marginTop)
7699
7712
  + parseFloat(styles.marginBottom));
7700
7713
  draEleTop = (draEleTop + helperHeight) > this.dragLimit.bottom ? (this.dragLimit.bottom - helperHeight) : draEleTop;
@@ -7768,7 +7781,7 @@ let Draggable = Draggable_1 = class Draggable extends Base {
7768
7781
  }
7769
7782
  }
7770
7783
  else if (nodeEle && nodeEle !== document.scrollingElement) {
7771
- if ((nodeEle.clientHeight + nodeEle.getBoundingClientRect().top - this.helperElement.clientHeight + document.scrollingElement.scrollTop - this.borderWidth.top - this.borderWidth.bottom) <= draEleTop) {
7784
+ if ((nodeEle.clientHeight + nodeEle.getBoundingClientRect().top - this.helperElement.clientHeight + document.scrollingElement.scrollTop) < draEleTop) {
7772
7785
  nodeEle.scrollTop += this.helperElement.clientHeight;
7773
7786
  }
7774
7787
  else if (nodeEle.getBoundingClientRect().top > (draEleTop - this.helperElement.clientHeight - document.scrollingElement.scrollTop)) {
@@ -7874,7 +7887,7 @@ let Draggable = Draggable_1 = class Draggable extends Base {
7874
7887
  if (ele) {
7875
7888
  let elementArea = ele.getBoundingClientRect();
7876
7889
  eleWidthBound = ele.scrollWidth ? ele.scrollWidth : elementArea.right - elementArea.left;
7877
- eleHeightBound = ele.scrollHeight ? (this.dragArea && this.helperElement.classList.contains('e-treeview')) ? ele.clientHeight : ele.scrollHeight : elementArea.bottom - elementArea.top;
7890
+ eleHeightBound = ele.scrollHeight ? (this.dragArea && !isNullOrUndefined(this.helperElement) && this.helperElement.classList.contains('e-treeview')) ? ele.clientHeight : ele.scrollHeight : elementArea.bottom - elementArea.top;
7878
7891
  let keys = ['Top', 'Left', 'Bottom', 'Right'];
7879
7892
  let styles = getComputedStyle(ele);
7880
7893
  for (let i = 0; i < keys.length; i++) {
@@ -7885,7 +7898,12 @@ let Draggable = Draggable_1 = class Draggable extends Base {
7885
7898
  this.borderWidth[lowerKey] = isNaN(parseFloat(tborder)) ? 0 : parseFloat(tborder);
7886
7899
  this.padding[lowerKey] = isNaN(parseFloat(tpadding)) ? 0 : parseFloat(tpadding);
7887
7900
  }
7888
- top = elementArea.top + document.scrollingElement.scrollTop;
7901
+ if (this.dragArea && !isNullOrUndefined(this.helperElement) && this.helperElement.classList.contains('e-treeview')) {
7902
+ top = elementArea.top + document.scrollingElement.scrollTop;
7903
+ }
7904
+ else {
7905
+ top = elementArea.top;
7906
+ }
7889
7907
  left = elementArea.left;
7890
7908
  this.dragLimit.left = left + this.borderWidth.left + this.padding.left;
7891
7909
  this.dragLimit.top = ele.offsetTop + this.borderWidth.top + this.padding.top;