@syncfusion/ej2-treegrid 28.2.3 → 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.
@@ -13433,8 +13433,16 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13433
13433
  if (isNullOrUndefined(this.observer[`${containerRect}`])) {
13434
13434
  this.observer[`${containerRect}`] = this.observers[`${containerRect}`];
13435
13435
  }
13436
- if (isNullOrUndefined(this.parent.clipboardModule['treeGridParent'].editModule) || args.selectedIndex !== 0 ||
13437
- isNullOrUndefined(this.parent.clipboardModule['treeGridParent'].editModule['addRowIndex'])) {
13436
+ const treeGridParent = this.parent.clipboardModule['treeGridParent'];
13437
+ if (isNullOrUndefined(treeGridParent.editModule) ||
13438
+ isNullOrUndefined(treeGridParent.editModule['addRowIndex']) || args.selectedIndex !== 0) {
13439
+ if (!isNullOrUndefined(treeGridParent.grid.sortModule) && treeGridParent.grid.sortModule['sortedColumns'].length > 0) {
13440
+ const sortedData = treeGridParent.dataModule['sortedData'];
13441
+ if (!isNullOrUndefined(sortedData) && sortedData.length > 0) {
13442
+ const targetIndex = sortedData.findIndex((record) => record.index === args.selectedIndex);
13443
+ args.selectedIndex = targetIndex;
13444
+ }
13445
+ }
13438
13446
  super[`${selectVirtualRow}`](args);
13439
13447
  }
13440
13448
  }