@syncfusion/ej2-filemanager 28.2.6 → 28.2.9

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.
@@ -4770,7 +4770,7 @@ class LargeIconsView {
4770
4770
  this.items = this.allItems = getSortedData(this.parent, this.items);
4771
4771
  }
4772
4772
  iconsView.classList.remove(DISPLAY_NONE);
4773
- if (this.parent.enableVirtualization && this.allItems.length > 0) {
4773
+ if (this.parent.enableVirtualization && this.allItems.length > 0 && !isNullOrUndefined(this.parent.virtualizationModule)) {
4774
4774
  this.parent.virtualizationModule.setUIVirtualization();
4775
4775
  }
4776
4776
  this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj);
@@ -4812,7 +4812,7 @@ class LargeIconsView {
4812
4812
  this.getItemCount();
4813
4813
  this.addEventListener();
4814
4814
  this.wireEvents();
4815
- if (this.parent.enableVirtualization && this.allItems.length > 0) {
4815
+ if (this.parent.enableVirtualization && this.allItems.length > 0 && !isNullOrUndefined(this.parent.virtualizationModule)) {
4816
4816
  this.parent.virtualizationModule.setUlElementHeight();
4817
4817
  this.parent.virtualizationModule.wireScrollEvent(false);
4818
4818
  }
@@ -7487,6 +7487,11 @@ let FileManager = FileManager_1 = class FileManager extends Component {
7487
7487
  //Specifies whether the operating system is MAC or not
7488
7488
  this.isMac = false;
7489
7489
  this.dragSelectedItems = [];
7490
+ this.onScrollHandler = () => {
7491
+ if (!isNullOrUndefined(this.contextmenuModule) && !isNullOrUndefined(this.contextmenuModule.contextMenu)) {
7492
+ this.contextmenuModule.contextMenu.close();
7493
+ }
7494
+ };
7490
7495
  FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu);
7491
7496
  }
7492
7497
  /**
@@ -8111,6 +8116,9 @@ let FileManager = FileManager_1 = class FileManager extends Component {
8111
8116
  this.wireSelectOnDragEvent(true);
8112
8117
  }
8113
8118
  EventHandler.add(window, 'resize', this.resizeHandler, this);
8119
+ if (this.contextMenuSettings.visible) {
8120
+ this.element.addEventListener('scroll', this.onScrollHandler, true);
8121
+ }
8114
8122
  this.keyboardModule = new KeyboardEvents(this.element, {
8115
8123
  keyAction: this.keyActionHandler.bind(this),
8116
8124
  keyConfigs: this.keyConfigs,
@@ -8120,6 +8128,9 @@ let FileManager = FileManager_1 = class FileManager extends Component {
8120
8128
  unWireEvents() {
8121
8129
  this.wireSelectOnDragEvent(false);
8122
8130
  EventHandler.remove(window, 'resize', this.resizeHandler);
8131
+ if (this.contextMenuSettings.visible) {
8132
+ this.element.removeEventListener('scroll', this.onScrollHandler, true);
8133
+ }
8123
8134
  this.keyboardModule.destroy();
8124
8135
  }
8125
8136
  onDragStart(event) {
@@ -11061,9 +11072,7 @@ class DetailsView {
11061
11072
  /* istanbul ignore next */
11062
11073
  onDataBound() {
11063
11074
  this.createDragObj();
11064
- if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization) ||
11065
- ((this.parent.selectedItems.length !== 0 && this.parent.enableVirtualization &&
11066
- this.element.querySelector('.e-content').scrollTop === 0))) {
11075
+ if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization)) {
11067
11076
  this.selectRecords(this.parent.selectedItems);
11068
11077
  }
11069
11078
  if (this.isPasteOperation === true && (!isNullOrUndefined(this.gridObj.getDataRows()) && this.gridObj.getDataRows().length > 0)) {
@@ -11823,7 +11832,9 @@ class DetailsView {
11823
11832
  if (this.gridObj.getSelectedRowIndexes().length !== 1) {
11824
11833
  const lastItemIndex = this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length - 2];
11825
11834
  const lastItem = this.gridObj.getRowByIndex(lastItemIndex);
11826
- lastItem.querySelector('.e-checkselect').setAttribute('tabindex', '-1');
11835
+ if (!isNullOrUndefined(lastItem)) {
11836
+ lastItem.querySelector('.e-checkselect').setAttribute('tabindex', '-1');
11837
+ }
11827
11838
  }
11828
11839
  item.querySelector('.e-rowcell.e-fe-checkbox').removeAttribute('tabindex');
11829
11840
  }
@@ -11888,11 +11899,17 @@ class DetailsView {
11888
11899
  onDeSelection(args) {
11889
11900
  /* istanbul ignore next */
11890
11901
  if (!this.parent.allowMultiSelection && isNullOrUndefined(args.data)) {
11891
- this.gridObj.getRowByIndex(args.rowIndex).removeAttribute('tabindex');
11902
+ const item = this.gridObj.getRowByIndex(args.rowIndex);
11903
+ if (!isNullOrUndefined(item)) {
11904
+ item.removeAttribute('tabindex');
11905
+ }
11892
11906
  }
11893
11907
  else if (this.gridObj.getSelectedRowIndexes().length > 1) {
11894
11908
  const lastItemIndex = this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length - 2];
11895
- this.gridObj.getRowByIndex(lastItemIndex).querySelector('.e-checkselect').removeAttribute('tabindex');
11909
+ const lastItem = this.gridObj.getRowByIndex(lastItemIndex);
11910
+ if (!isNullOrUndefined(lastItem)) {
11911
+ lastItem.querySelector('.e-checkselect').removeAttribute('tabindex');
11912
+ }
11896
11913
  }
11897
11914
  if (this.gridObj.selectedRowIndex === -1) {
11898
11915
  this.gridObj.element.setAttribute('tabindex', '0');