@syncfusion/ej2-filemanager 19.4.43 → 19.4.47

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.
@@ -1019,7 +1019,13 @@ function searchWordHandler(parent, value, isLayoutChange) {
1019
1019
  }
1020
1020
  else {
1021
1021
  if (!parent.isFiltered) {
1022
- read(parent, isLayoutChange ? layoutChange : search, parent.path);
1022
+ if (parent.isSortByClicked) {
1023
+ parent.notify(layoutChange, { files: parent.largeiconsviewModule.items });
1024
+ parent.isSortByClicked = false;
1025
+ }
1026
+ else {
1027
+ read(parent, isLayoutChange ? layoutChange : search, parent.path);
1028
+ }
1023
1029
  }
1024
1030
  else {
1025
1031
  filter(parent, layoutChange);
@@ -1430,6 +1436,7 @@ function getCssClass(parent, css) {
1430
1436
  */
1431
1437
  function sortbyClickHandler(parent, args) {
1432
1438
  var tick;
1439
+ parent.isSortByClicked = true;
1433
1440
  if (args.item.id.indexOf('ascending') !== -1 || args.item.id.indexOf('descending') !== -1 || args.item.id.indexOf('none') !== -1) {
1434
1441
  tick = true;
1435
1442
  }
@@ -5862,9 +5869,6 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
5862
5869
  target = this.parent.navigationpaneModule.activeNode.getElementsByClassName(FULLROW)[0];
5863
5870
  this.menuTarget = this.targetNodeElement = target;
5864
5871
  }
5865
- if (target.classList.contains(FULLROW)) {
5866
- this.parent.selectedItems.length = 0;
5867
- }
5868
5872
  this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr.e-row') : target;
5869
5873
  var view = this.getTargetView(target);
5870
5874
  this.updateActiveModule();
@@ -6551,6 +6555,8 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
6551
6555
  _this.folderPath = '';
6552
6556
  _this.isSameAction = false;
6553
6557
  _this.isFiltered = false;
6558
+ // Specifies whether the sort by option is clicked or not.
6559
+ _this.isSortByClicked = false;
6554
6560
  _this.enablePaste = false;
6555
6561
  _this.persistData = false;
6556
6562
  _this.retryArgs = [];
@@ -8398,6 +8404,7 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8398
8404
  NavigationPane.prototype.onNodeSelecting = function (args) {
8399
8405
  if (!args.isInteracted && !this.isRightClick && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
8400
8406
  this.restrictSelecting = false;
8407
+ this.isNodeClickCalled = false;
8401
8408
  return;
8402
8409
  }
8403
8410
  if (!this.renameParent) {
@@ -8405,13 +8412,12 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8405
8412
  // eslint-disable-next-line
8406
8413
  var nodeData = this.getTreeData(getValue('id', args.nodeData));
8407
8414
  var eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
8408
- delete eventArgs.cancel;
8409
8415
  this.parent.trigger('fileOpen', eventArgs);
8410
8416
  args.cancel = eventArgs.cancel;
8411
8417
  if (args.cancel) {
8412
- this.restrictSelecting = true;
8418
+ this.restrictSelecting = this.isNodeClickCalled ? this.previousSelected[0] != args.node.getAttribute('data-uid') : false;
8413
8419
  this.treeObj.selectedNodes = this.isNodeClickCalled ? this.previousSelected : this.treeObj.selectedNodes;
8414
- this.isNodeClickCalled = false;
8420
+ this.previousSelected = this.treeObj.selectedNodes;
8415
8421
  if (!isNullOrUndefined(this.parent) && !isNullOrUndefined(this.parent.contextmenuModule)) {
8416
8422
  this.parent.contextmenuModule.contextMenu.enableItems(['Open'], true);
8417
8423
  }
@@ -8486,11 +8492,11 @@ var NavigationPane = /** @__PURE__ @class */ (function () {
8486
8492
  };
8487
8493
  NavigationPane.prototype.onNodeClicked = function (args) {
8488
8494
  this.parent.activeModule = 'navigationpane';
8495
+ this.previousSelected = this.treeObj.selectedNodes;
8489
8496
  this.activeNode = args.node;
8490
8497
  if ((args.event.which === 3) && (args.node.getAttribute('data-uid') !== this.treeObj.selectedNodes[0])) {
8491
8498
  this.isRightClick = true;
8492
8499
  this.isNodeClickCalled = true;
8493
- this.previousSelected = this.treeObj.selectedNodes;
8494
8500
  this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
8495
8501
  }
8496
8502
  else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && this.parent.selectedItems.length !== 0) {