@syncfusion/ej2-dropdowns 28.2.5 → 28.2.6

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.
@@ -1212,7 +1212,8 @@ let DropDownBase = class DropDownBase extends Component {
1212
1212
  }
1213
1213
  getSkeletonCount(retainSkeleton) {
1214
1214
  this.virtualListHeight = this.listContainerHeight != null ? parseInt(this.listContainerHeight, 10) : this.virtualListHeight;
1215
- const actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
1215
+ const actualCount = this.virtualListHeight > 0 && this.listItemHeight > 0 ?
1216
+ Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
1216
1217
  this.skeletonCount = actualCount * 4 < this.itemCount ? this.itemCount : actualCount * 4;
1217
1218
  this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
1218
1219
  this.virtualItemCount = this.itemCount;
@@ -8858,11 +8859,9 @@ let DropDownTree = class DropDownTree extends Component {
8858
8859
  removeClass([this.popupEle], DDTHIDEICON);
8859
8860
  this.updatePopupHeight();
8860
8861
  this.popupObj.refreshPosition();
8861
- if (this.showSelectAll && !this.allowFiltering) {
8862
- this.checkAllParent.focus();
8863
- }
8864
- if ((!this.popupDiv.classList.contains(NODATA) && this.treeItems.length > 0)) {
8865
- let focusedElement = this.value != null || this.text != null ? this.treeObj.element.querySelector('[data-uid="' + this.value[0] + '"]') : null;
8862
+ if (!(this.showSelectAll || this.allowFiltering) && (!this.popupDiv.classList.contains(NODATA)
8863
+ && this.treeItems.length > 0)) {
8864
+ let focusedElement = this.value != null && this.text != null ? this.treeObj.element.querySelector('[data-uid="' + this.value[0] + '"]') : null;
8866
8865
  if (focusedElement) {
8867
8866
  this.treeObj.element.querySelector('li').setAttribute('tabindex', '-1');
8868
8867
  focusedElement.setAttribute('tabindex', '0');
@@ -8871,17 +8870,9 @@ let DropDownTree = class DropDownTree extends Component {
8871
8870
  const oldFocussedNode = this.treeObj.element.querySelector('.e-node-focus');
8872
8871
  focusedElement = this.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)') ||
8873
8872
  this.treeObj.element.querySelector('li:not(.e-disable)');
8874
- if (oldFocussedNode && oldFocussedNode !== focusedElement) {
8875
- oldFocussedNode.setAttribute('tabindex', '-1');
8876
- removeClass([oldFocussedNode], 'e-node-focus');
8877
- }
8878
- }
8879
- if (!isNullOrUndefined(focusedElement)) {
8880
- if (!this.allowFiltering) {
8881
- focusedElement.focus();
8882
- }
8883
- addClass([focusedElement], ['e-node-focus']);
8873
+ this.removeFocus(focusedElement, oldFocussedNode);
8884
8874
  }
8875
+ this.updateFocus(focusedElement);
8885
8876
  }
8886
8877
  if (this.treeObj.checkedNodes.length > 0 && !this.isFilterRestore) {
8887
8878
  const nodes = this.treeObj.element.querySelectorAll('li');
@@ -8892,6 +8883,12 @@ let DropDownTree = class DropDownTree extends Component {
8892
8883
  this.checkSelectAll = false;
8893
8884
  }
8894
8885
  }
8886
+ if (this.showSelectAll && !this.allowFiltering) {
8887
+ const oldFocussedNode = this.treeObj.element.querySelector('.e-node-focus');
8888
+ const focusedElement = this.popupEle.querySelector('.e-selectall-parent');
8889
+ this.removeFocus(focusedElement, oldFocussedNode);
8890
+ this.updateFocus(focusedElement);
8891
+ }
8895
8892
  if (this.allowFiltering) {
8896
8893
  removeClass([this.inputWrapper], [INPUTFOCUS]);
8897
8894
  this.filterObj.element.focus();
@@ -8901,6 +8898,18 @@ let DropDownTree = class DropDownTree extends Component {
8901
8898
  }
8902
8899
  });
8903
8900
  }
8901
+ removeFocus(focusedElement, oldFocusedElement) {
8902
+ if (oldFocusedElement && oldFocusedElement !== focusedElement) {
8903
+ oldFocusedElement.setAttribute('tabindex', '-1');
8904
+ removeClass([oldFocusedElement], 'e-node-focus');
8905
+ }
8906
+ }
8907
+ updateFocus(focusedElement) {
8908
+ if (!isNullOrUndefined(focusedElement)) {
8909
+ focusedElement.focus();
8910
+ addClass([focusedElement], ['e-node-focus']);
8911
+ }
8912
+ }
8904
8913
  reactCallBack() {
8905
8914
  if (!isNullOrUndefined(this.popupObj)) {
8906
8915
  this.updatePopupHeight();
@@ -16236,7 +16245,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16236
16245
  (this.mode === 'Box' || this.mode === 'Default'))) ||
16237
16246
  (this.enableVirtualization && value != null && text != null && !isCustomData)) {
16238
16247
  const currentText = [];
16239
- const textValues = this.isDynamicRemoteVirtualData && text != null && text !== '' ? text : this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
16248
+ const textValues = this.isDynamicRemoteVirtualData && text != null && text !== '' ? text : this.text != null && this.text !== '' && !this.text.includes(text) ? this.text + this.delimiterChar + text : text;
16240
16249
  currentText.push(textValues);
16241
16250
  this.setProperties({ text: currentText.toString() }, true);
16242
16251
  this.addChip(text, value);