@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.
@@ -4926,7 +4926,7 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
4926
4926
  this.items = this.allItems = getSortedData(this.parent, this.items);
4927
4927
  }
4928
4928
  iconsView.classList.remove(DISPLAY_NONE);
4929
- if (this.parent.enableVirtualization && this.allItems.length > 0) {
4929
+ if (this.parent.enableVirtualization && this.allItems.length > 0 && !isNullOrUndefined(this.parent.virtualizationModule)) {
4930
4930
  this.parent.virtualizationModule.setUIVirtualization();
4931
4931
  }
4932
4932
  this.listElements = ListBase.createListFromJson(createElement, this.items, this.listObj);
@@ -4968,7 +4968,7 @@ var LargeIconsView = /** @__PURE__ @class */ (function () {
4968
4968
  this.getItemCount();
4969
4969
  this.addEventListener();
4970
4970
  this.wireEvents();
4971
- if (this.parent.enableVirtualization && this.allItems.length > 0) {
4971
+ if (this.parent.enableVirtualization && this.allItems.length > 0 && !isNullOrUndefined(this.parent.virtualizationModule)) {
4972
4972
  this.parent.virtualizationModule.setUlElementHeight();
4973
4973
  this.parent.virtualizationModule.wireScrollEvent(false);
4974
4974
  }
@@ -7670,6 +7670,11 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
7670
7670
  //Specifies whether the operating system is MAC or not
7671
7671
  _this.isMac = false;
7672
7672
  _this.dragSelectedItems = [];
7673
+ _this.onScrollHandler = function () {
7674
+ if (!isNullOrUndefined(_this.contextmenuModule) && !isNullOrUndefined(_this.contextmenuModule.contextMenu)) {
7675
+ _this.contextmenuModule.contextMenu.close();
7676
+ }
7677
+ };
7673
7678
  FileManager_1.Inject(BreadCrumbBar, LargeIconsView, ContextMenu);
7674
7679
  return _this;
7675
7680
  }
@@ -8296,6 +8301,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
8296
8301
  this.wireSelectOnDragEvent(true);
8297
8302
  }
8298
8303
  EventHandler.add(window, 'resize', this.resizeHandler, this);
8304
+ if (this.contextMenuSettings.visible) {
8305
+ this.element.addEventListener('scroll', this.onScrollHandler, true);
8306
+ }
8299
8307
  this.keyboardModule = new KeyboardEvents(this.element, {
8300
8308
  keyAction: this.keyActionHandler.bind(this),
8301
8309
  keyConfigs: this.keyConfigs,
@@ -8305,6 +8313,9 @@ var FileManager = /** @__PURE__ @class */ (function (_super) {
8305
8313
  FileManager.prototype.unWireEvents = function () {
8306
8314
  this.wireSelectOnDragEvent(false);
8307
8315
  EventHandler.remove(window, 'resize', this.resizeHandler);
8316
+ if (this.contextMenuSettings.visible) {
8317
+ this.element.removeEventListener('scroll', this.onScrollHandler, true);
8318
+ }
8308
8319
  this.keyboardModule.destroy();
8309
8320
  };
8310
8321
  FileManager.prototype.onDragStart = function (event) {
@@ -11272,9 +11283,7 @@ var DetailsView = /** @__PURE__ @class */ (function () {
11272
11283
  /* istanbul ignore next */
11273
11284
  DetailsView.prototype.onDataBound = function () {
11274
11285
  this.createDragObj();
11275
- if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization) ||
11276
- ((this.parent.selectedItems.length !== 0 && this.parent.enableVirtualization &&
11277
- this.element.querySelector('.e-content').scrollTop === 0))) {
11286
+ if ((this.parent.selectedItems.length !== 0 && !this.parent.enableVirtualization)) {
11278
11287
  this.selectRecords(this.parent.selectedItems);
11279
11288
  }
11280
11289
  if (this.isPasteOperation === true && (!isNullOrUndefined(this.gridObj.getDataRows()) && this.gridObj.getDataRows().length > 0)) {
@@ -12037,7 +12046,9 @@ var DetailsView = /** @__PURE__ @class */ (function () {
12037
12046
  if (this.gridObj.getSelectedRowIndexes().length !== 1) {
12038
12047
  var lastItemIndex = this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length - 2];
12039
12048
  var lastItem = this.gridObj.getRowByIndex(lastItemIndex);
12040
- lastItem.querySelector('.e-checkselect').setAttribute('tabindex', '-1');
12049
+ if (!isNullOrUndefined(lastItem)) {
12050
+ lastItem.querySelector('.e-checkselect').setAttribute('tabindex', '-1');
12051
+ }
12041
12052
  }
12042
12053
  item.querySelector('.e-rowcell.e-fe-checkbox').removeAttribute('tabindex');
12043
12054
  }
@@ -12102,11 +12113,17 @@ var DetailsView = /** @__PURE__ @class */ (function () {
12102
12113
  DetailsView.prototype.onDeSelection = function (args) {
12103
12114
  /* istanbul ignore next */
12104
12115
  if (!this.parent.allowMultiSelection && isNullOrUndefined(args.data)) {
12105
- this.gridObj.getRowByIndex(args.rowIndex).removeAttribute('tabindex');
12116
+ var item = this.gridObj.getRowByIndex(args.rowIndex);
12117
+ if (!isNullOrUndefined(item)) {
12118
+ item.removeAttribute('tabindex');
12119
+ }
12106
12120
  }
12107
12121
  else if (this.gridObj.getSelectedRowIndexes().length > 1) {
12108
12122
  var lastItemIndex = this.gridObj.getSelectedRowIndexes()[this.gridObj.getSelectedRowIndexes().length - 2];
12109
- this.gridObj.getRowByIndex(lastItemIndex).querySelector('.e-checkselect').removeAttribute('tabindex');
12123
+ var lastItem = this.gridObj.getRowByIndex(lastItemIndex);
12124
+ if (!isNullOrUndefined(lastItem)) {
12125
+ lastItem.querySelector('.e-checkselect').removeAttribute('tabindex');
12126
+ }
12110
12127
  }
12111
12128
  if (this.gridObj.selectedRowIndex === -1) {
12112
12129
  this.gridObj.element.setAttribute('tabindex', '0');