@syncfusion/ej2-dropdowns 28.2.4 → 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;
@@ -5299,6 +5300,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5299
5300
  }
5300
5301
  const args = { cancel: false };
5301
5302
  this.trigger('beforeOpen', args, (args) => {
5303
+ let initialPopupHeight;
5302
5304
  if (!args.cancel) {
5303
5305
  const popupEle = this.createElement('div', {
5304
5306
  id: this.element.id + '_popup', className: 'e-ddl e-popup ' + (this.cssClass !== null ? this.cssClass : '')
@@ -5319,6 +5321,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5319
5321
  }
5320
5322
  document.body.appendChild(popupEle);
5321
5323
  popupEle.style.top = '0px';
5324
+ initialPopupHeight = popupEle.clientHeight;
5322
5325
  if (this.enableVirtualization && this.itemTemplate) {
5323
5326
  const listitems = popupEle.querySelectorAll('li.e-list-item:not(.e-virtual-list)');
5324
5327
  this.listItemHeight = listitems.length > 0 ? Math.ceil(listitems[0].getBoundingClientRect().height) +
@@ -5515,7 +5518,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5515
5518
  // Add the resizer div to the popup
5516
5519
  if (this.list && this.list.parentElement) {
5517
5520
  this.list.parentElement.classList.add('e-resize');
5518
- if (this.popupHeight.toString().toLowerCase() !== 'auto') {
5521
+ if (this.popupHeight.toString().toLowerCase() !== 'auto' && initialPopupHeight > parseInt(this.popupHeight.toString(), 10)) {
5519
5522
  this.list.parentElement.style.height = '100%';
5520
5523
  }
5521
5524
  this.list.parentElement.style.paddingBottom = (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.searchBoxHeight) ? (this.searchBoxHeight + resizePaddingBottom).toString() + 'px' : resizePaddingBottom.toString() + 'px';
@@ -8496,7 +8499,7 @@ let DropDownTree = class DropDownTree extends Component {
8496
8499
  this.inputEle.setAttribute('aria-label', this.getModuleName());
8497
8500
  const id = this.element.getAttribute('id');
8498
8501
  this.hiddenElement.id = id + '_hidden';
8499
- this.inputWrapper.setAttribute('tabindex', '0');
8502
+ this.inputWrapper.setAttribute('tabindex', this.inputWrapper.classList.contains('e-disabled') ? '-1' : '0');
8500
8503
  this.inputWrapper.setAttribute('aria-label', this.getModuleName());
8501
8504
  attributes(this.inputWrapper, this.getAriaAttributes());
8502
8505
  }
@@ -8856,7 +8859,7 @@ let DropDownTree = class DropDownTree extends Component {
8856
8859
  removeClass([this.popupEle], DDTHIDEICON);
8857
8860
  this.updatePopupHeight();
8858
8861
  this.popupObj.refreshPosition();
8859
- if (!(this.showCheckBox && this.showSelectAll) && (!this.popupDiv.classList.contains(NODATA)
8862
+ if (!(this.showSelectAll || this.allowFiltering) && (!this.popupDiv.classList.contains(NODATA)
8860
8863
  && this.treeItems.length > 0)) {
8861
8864
  let focusedElement = this.value != null && this.text != null ? this.treeObj.element.querySelector('[data-uid="' + this.value[0] + '"]') : null;
8862
8865
  if (focusedElement) {
@@ -8867,17 +8870,9 @@ let DropDownTree = class DropDownTree extends Component {
8867
8870
  const oldFocussedNode = this.treeObj.element.querySelector('.e-node-focus');
8868
8871
  focusedElement = this.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)') ||
8869
8872
  this.treeObj.element.querySelector('li:not(.e-disable)');
8870
- if (oldFocussedNode && oldFocussedNode !== focusedElement) {
8871
- oldFocussedNode.setAttribute('tabindex', '-1');
8872
- removeClass([oldFocussedNode], 'e-node-focus');
8873
- }
8874
- }
8875
- if (!isNullOrUndefined(focusedElement)) {
8876
- if (!this.allowFiltering) {
8877
- focusedElement.focus();
8878
- }
8879
- addClass([focusedElement], ['e-node-focus']);
8873
+ this.removeFocus(focusedElement, oldFocussedNode);
8880
8874
  }
8875
+ this.updateFocus(focusedElement);
8881
8876
  }
8882
8877
  if (this.treeObj.checkedNodes.length > 0 && !this.isFilterRestore) {
8883
8878
  const nodes = this.treeObj.element.querySelectorAll('li');
@@ -8888,6 +8883,12 @@ let DropDownTree = class DropDownTree extends Component {
8888
8883
  this.checkSelectAll = false;
8889
8884
  }
8890
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
+ }
8891
8892
  if (this.allowFiltering) {
8892
8893
  removeClass([this.inputWrapper], [INPUTFOCUS]);
8893
8894
  this.filterObj.element.focus();
@@ -8897,6 +8898,18 @@ let DropDownTree = class DropDownTree extends Component {
8897
8898
  }
8898
8899
  });
8899
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
+ }
8900
8913
  reactCallBack() {
8901
8914
  if (!isNullOrUndefined(this.popupObj)) {
8902
8915
  this.updatePopupHeight();
@@ -9197,7 +9210,9 @@ let DropDownTree = class DropDownTree extends Component {
9197
9210
  this.updateTemplate();
9198
9211
  }
9199
9212
  this.treeObj.fields = this.getTreeFields(this.fields);
9213
+ this.setProperties({ value: this.oldValue }, true);
9200
9214
  this.treeObj.dataBind();
9215
+ this.updateValue(this.value);
9201
9216
  }
9202
9217
  getEventArgs(args) {
9203
9218
  const checkData = args.data;
@@ -10208,8 +10223,10 @@ let DropDownTree = class DropDownTree extends Component {
10208
10223
  this.updateFilterPlaceHolder();
10209
10224
  break;
10210
10225
  case 'value':
10211
- this.oldValue = oldProp.value;
10212
- this.updateValue(newProp.value);
10226
+ if (JSON.stringify(oldProp.value) !== JSON.stringify(newProp.value)) {
10227
+ this.oldValue = oldProp.value;
10228
+ this.updateValue(newProp.value);
10229
+ }
10213
10230
  break;
10214
10231
  case 'text':
10215
10232
  this.updateText(newProp.text);
@@ -16228,7 +16245,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16228
16245
  (this.mode === 'Box' || this.mode === 'Default'))) ||
16229
16246
  (this.enableVirtualization && value != null && text != null && !isCustomData)) {
16230
16247
  const currentText = [];
16231
- 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;
16232
16249
  currentText.push(textValues);
16233
16250
  this.setProperties({ text: currentText.toString() }, true);
16234
16251
  this.addChip(text, value);