@syncfusion/ej2-dropdowns 19.4.50 → 19.4.52

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.
@@ -637,7 +637,7 @@ let DropDownBase = class DropDownBase extends Component {
637
637
  }
638
638
  this.bindChildItems(localDataArgs.result, ulElement, fields);
639
639
  setTimeout(() => {
640
- if (this.getModuleName() === 'multiselect' && this.itemTemplate != null && (ulElement.childElementCount > 0 && ulElement.children[0].childElementCount > 0)) {
640
+ if (this.getModuleName() === 'multiselect' && this.itemTemplate != null && (ulElement.childElementCount > 0 && (ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && ulElement.children[1] && ulElement.children[1].childElementCount > 0)))) {
641
641
  this.updateDataList();
642
642
  }
643
643
  });
@@ -723,7 +723,6 @@ let DropDownBase = class DropDownBase extends Component {
723
723
  if (this.isReact) {
724
724
  this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
725
725
  }
726
- this.list.innerHTML = '';
727
726
  this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
728
727
  if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
729
728
  for (let i = 0; i < ulElement.childElementCount; i++) {
@@ -734,10 +733,13 @@ let DropDownBase = class DropDownBase extends Component {
734
733
  }
735
734
  }
736
735
  }
737
- this.list.appendChild(ulElement);
738
- this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
739
- this.ulElement = this.list.querySelector('ul');
740
- this.postRender(this.list, list, this.bindEvent);
736
+ if (!isNullOrUndefined(this.list)) {
737
+ this.list.innerHTML = '';
738
+ this.list.appendChild(ulElement);
739
+ this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
740
+ this.ulElement = this.list.querySelector('ul');
741
+ this.postRender(this.list, list, this.bindEvent);
742
+ }
741
743
  }
742
744
  /* eslint-disable @typescript-eslint/no-unused-vars */
743
745
  postRender(listElement, list, bindEvent) {
@@ -8948,7 +8950,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8948
8950
  return ariaAttributes;
8949
8951
  }
8950
8952
  updateListARIA() {
8951
- attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
8953
+ if (!isNullOrUndefined(this.ulElement)) {
8954
+ attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
8955
+ }
8952
8956
  const disableStatus = (this.inputElement.disabled) ? true : false;
8953
8957
  attributes(this.inputElement, this.getAriaAttributes());
8954
8958
  if (disableStatus) {
@@ -11076,8 +11080,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11076
11080
  }
11077
11081
  }
11078
11082
  updateDataList() {
11079
- if (this.mainList && this.ulElement && (this.mainList.childElementCount < this.ulElement.childElementCount || ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount)))) {
11080
- this.mainList = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
11083
+ if (this.mainList && this.ulElement) {
11084
+ let isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
11085
+ let isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
11086
+ let isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0 && (this.ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
11087
+ if (isDynamicGroupItemUpdate || isReactTemplateUpdate || isAngularTemplateUpdate) {
11088
+ this.mainList = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
11089
+ }
11081
11090
  }
11082
11091
  }
11083
11092
  isValidLI(li) {
@@ -11424,11 +11433,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11424
11433
  }
11425
11434
  }
11426
11435
  wireListEvents() {
11427
- EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
11428
- EventHandler.add(this.list, 'mousedown', this.onListMouseDown, this);
11429
- EventHandler.add(this.list, 'mouseup', this.onMouseClick, this);
11430
- EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
11431
- EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
11436
+ if (!isNullOrUndefined(this.list)) {
11437
+ EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
11438
+ EventHandler.add(this.list, 'mousedown', this.onListMouseDown, this);
11439
+ EventHandler.add(this.list, 'mouseup', this.onMouseClick, this);
11440
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
11441
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
11442
+ }
11432
11443
  }
11433
11444
  unwireListEvents() {
11434
11445
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);