@syncfusion/ej2-treegrid 28.1.39 → 28.2.4

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.
@@ -13868,8 +13868,16 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
13868
13868
  if (isNullOrUndefined(this.observer["" + containerRect])) {
13869
13869
  this.observer["" + containerRect] = this.observers["" + containerRect];
13870
13870
  }
13871
- if (isNullOrUndefined(this.parent.clipboardModule['treeGridParent'].editModule) || args.selectedIndex !== 0 ||
13872
- isNullOrUndefined(this.parent.clipboardModule['treeGridParent'].editModule['addRowIndex'])) {
13871
+ var treeGridParent = this.parent.clipboardModule['treeGridParent'];
13872
+ if (isNullOrUndefined(treeGridParent.editModule) ||
13873
+ isNullOrUndefined(treeGridParent.editModule['addRowIndex']) || args.selectedIndex !== 0) {
13874
+ if (!isNullOrUndefined(treeGridParent.grid.sortModule) && treeGridParent.grid.sortModule['sortedColumns'].length > 0) {
13875
+ var sortedData = treeGridParent.dataModule['sortedData'];
13876
+ if (!isNullOrUndefined(sortedData) && sortedData.length > 0) {
13877
+ var targetIndex = sortedData.findIndex(function (record) { return record.index === args.selectedIndex; });
13878
+ args.selectedIndex = targetIndex;
13879
+ }
13880
+ }
13873
13881
  _super.prototype["" + selectVirtualRow].call(this, args);
13874
13882
  }
13875
13883
  };