@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.
@@ -875,7 +875,13 @@ function searchWordHandler(parent, value, isLayoutChange) {
875
875
  }
876
876
  else {
877
877
  if (!parent.isFiltered) {
878
- read(parent, isLayoutChange ? layoutChange : search, parent.path);
878
+ if (parent.isSortByClicked) {
879
+ parent.notify(layoutChange, { files: parent.largeiconsviewModule.items });
880
+ parent.isSortByClicked = false;
881
+ }
882
+ else {
883
+ read(parent, isLayoutChange ? layoutChange : search, parent.path);
884
+ }
879
885
  }
880
886
  else {
881
887
  filter(parent, layoutChange);
@@ -1286,6 +1292,7 @@ function getCssClass(parent, css) {
1286
1292
  */
1287
1293
  function sortbyClickHandler(parent, args) {
1288
1294
  let tick;
1295
+ parent.isSortByClicked = true;
1289
1296
  if (args.item.id.indexOf('ascending') !== -1 || args.item.id.indexOf('descending') !== -1 || args.item.id.indexOf('none') !== -1) {
1290
1297
  tick = true;
1291
1298
  }
@@ -5707,9 +5714,6 @@ class ContextMenu$2 {
5707
5714
  target = this.parent.navigationpaneModule.activeNode.getElementsByClassName(FULLROW)[0];
5708
5715
  this.menuTarget = this.targetNodeElement = target;
5709
5716
  }
5710
- if (target.classList.contains(FULLROW)) {
5711
- this.parent.selectedItems.length = 0;
5712
- }
5713
5717
  this.targetElement = this.parent.view === 'Details' ? closest(target, 'tr.e-row') : target;
5714
5718
  const view = this.getTargetView(target);
5715
5719
  this.updateActiveModule();
@@ -6380,6 +6384,8 @@ let FileManager = FileManager_1 = class FileManager extends Component {
6380
6384
  this.folderPath = '';
6381
6385
  this.isSameAction = false;
6382
6386
  this.isFiltered = false;
6387
+ // Specifies whether the sort by option is clicked or not.
6388
+ this.isSortByClicked = false;
6383
6389
  this.enablePaste = false;
6384
6390
  this.persistData = false;
6385
6391
  this.retryArgs = [];
@@ -8213,6 +8219,7 @@ class NavigationPane {
8213
8219
  onNodeSelecting(args) {
8214
8220
  if (!args.isInteracted && !this.isRightClick && !this.isPathDragged && !this.isRenameParent || this.restrictSelecting) {
8215
8221
  this.restrictSelecting = false;
8222
+ this.isNodeClickCalled = false;
8216
8223
  return;
8217
8224
  }
8218
8225
  if (!this.renameParent) {
@@ -8220,13 +8227,12 @@ class NavigationPane {
8220
8227
  // eslint-disable-next-line
8221
8228
  const nodeData = this.getTreeData(getValue('id', args.nodeData));
8222
8229
  const eventArgs = { cancel: false, fileDetails: nodeData[0], module: 'NavigationPane' };
8223
- delete eventArgs.cancel;
8224
8230
  this.parent.trigger('fileOpen', eventArgs);
8225
8231
  args.cancel = eventArgs.cancel;
8226
8232
  if (args.cancel) {
8227
- this.restrictSelecting = true;
8233
+ this.restrictSelecting = this.isNodeClickCalled ? this.previousSelected[0] != args.node.getAttribute('data-uid') : false;
8228
8234
  this.treeObj.selectedNodes = this.isNodeClickCalled ? this.previousSelected : this.treeObj.selectedNodes;
8229
- this.isNodeClickCalled = false;
8235
+ this.previousSelected = this.treeObj.selectedNodes;
8230
8236
  if (!isNullOrUndefined(this.parent) && !isNullOrUndefined(this.parent.contextmenuModule)) {
8231
8237
  this.parent.contextmenuModule.contextMenu.enableItems(['Open'], true);
8232
8238
  }
@@ -8301,11 +8307,11 @@ class NavigationPane {
8301
8307
  }
8302
8308
  onNodeClicked(args) {
8303
8309
  this.parent.activeModule = 'navigationpane';
8310
+ this.previousSelected = this.treeObj.selectedNodes;
8304
8311
  this.activeNode = args.node;
8305
8312
  if ((args.event.which === 3) && (args.node.getAttribute('data-uid') !== this.treeObj.selectedNodes[0])) {
8306
8313
  this.isRightClick = true;
8307
8314
  this.isNodeClickCalled = true;
8308
- this.previousSelected = this.treeObj.selectedNodes;
8309
8315
  this.treeObj.selectedNodes = [args.node.getAttribute('data-uid')];
8310
8316
  }
8311
8317
  else if (args.node.getAttribute('data-uid') === this.treeObj.selectedNodes[0] && this.parent.selectedItems.length !== 0) {