@syncfusion/ej2-treegrid 27.2.2 → 27.2.3

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.
@@ -13757,9 +13757,15 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
13757
13757
  firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('data-rowindex');
13758
13758
  }
13759
13759
  if (firsttdinx === 0) {
13760
- this.translateY = !isNullOrUndefined(this.endIndex) ?
13761
- (this.endIndex - this.parent.pageSettings.pageSize) * (this.parent.rowHeight ?
13762
- this.parent.rowHeight : this.parent.getRowHeight()) : 0;
13760
+ if (this.endIndex - this.startIndex < this.parent.pageSettings.pageSize) {
13761
+ this.translateY = !isNullOrUndefined(this.endIndex) ?
13762
+ (this.endIndex - this.parent.pageSettings.pageSize) * (this.parent.rowHeight ?
13763
+ this.parent.rowHeight : this.parent.getRowHeight()) : 0;
13764
+ }
13765
+ else {
13766
+ this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?
13767
+ scrollArgs.offset.top - (outBuffer * rowHeight) + rowHeight : 0;
13768
+ }
13763
13769
  }
13764
13770
  else if (this.parent.getFrozenColumns() > 0) {
13765
13771
  scrollArgs.offset.top = scrollArgs.offset.top + 80;
@@ -13793,6 +13799,8 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
13793
13799
  ((this.startIndex - currentViewData[0]["" + indexValue]) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
13794
13800
  this.startIndex = currentViewData[0]["" + indexValue] + (this.parent.pageSettings.pageSize / 2);
13795
13801
  }
13802
+ var selectedIndex = this.parent.root.selectedRowIndex;
13803
+ this.startIndex = selectedIndex !== -1 && selectedIndex !== this.startIndex ? this.startIndex - 1 : this.startIndex;
13796
13804
  if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
13797
13805
  this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
13798
13806
  }
@@ -13801,10 +13809,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
13801
13809
  this.translateY = (this.totalRecords * rowHeight) - ((this.endIndex - this.startIndex) * rowHeight);
13802
13810
  }
13803
13811
  else {
13804
- if (this.parent.allowRowDragAndDrop) {
13805
- this.translateY = scrollArgs.offset.top - rowHeight * 2;
13806
- }
13807
- else if (this.parent.getFrozenColumns() > 0) {
13812
+ if (this.parent.getFrozenColumns() > 0) {
13808
13813
  this.translateY = scrollArgs.offset.top - ((rowHeight * 2) + this.parent.pageSettings.pageSize);
13809
13814
  }
13810
13815
  else {