@syncfusion/ej2-dropdowns 21.2.5 → 21.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.
@@ -99,7 +99,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
99
99
  dataSource.filter(function (data) {
100
100
  Array.prototype.slice.call(fieldValue).forEach(function (value) {
101
101
  /* eslint-disable security/detect-object-injection */
102
- if (type === 'object' && checkField.textContent.toString().indexOf(data[value]) !== -1 && checkField.getAttribute('data-value') === data[fields.value].toString() || type === 'string' && checkField.textContent.toString().indexOf(data) !== -1) {
102
+ if (type === 'object' && (!data.isHeader && checkField.textContent.toString().indexOf(data[value]) !== -1) && checkField.getAttribute('data-value') === data[fields.value].toString() || type === 'string' && checkField.textContent.toString().indexOf(data) !== -1) {
103
103
  filterValue = type === 'object' ? data[value] : data;
104
104
  }
105
105
  });
@@ -2604,6 +2604,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2604
2604
  const index = this.isSelectCustom ? null : this.activeIndex;
2605
2605
  this.setProperties({ 'index': index, 'text': dataItem.text, 'value': dataItem.value }, true);
2606
2606
  this.detachChangeEvent(eve);
2607
+ this.dispatchEvent(this.hiddenElement, 'change');
2607
2608
  }
2608
2609
  detachChanges(value) {
2609
2610
  let items;
@@ -3274,7 +3275,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3274
3275
  this.isNotSearchList = false;
3275
3276
  this.isDocumentClick = false;
3276
3277
  this.destroyPopup();
3277
- EventHandler.remove(document, 'mousedown', this.onDocumentClick);
3278
3278
  if (this.isFiltering() && this.actionCompleteData.list && this.actionCompleteData.list[0]) {
3279
3279
  this.isActive = true;
3280
3280
  this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
@@ -10780,10 +10780,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10780
10780
  }
10781
10781
  }
10782
10782
  removeChipFocus() {
10783
- const elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1);
10784
- const closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
10783
+ const elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1 + '.' + CHIP_SELECTED);
10785
10784
  removeClass(elements, CHIP_SELECTED);
10786
10785
  if (Browser.isDevice) {
10786
+ const closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
10787
10787
  for (let index = 0; index < closeElements.length; index++) {
10788
10788
  closeElements[index].style.display = 'none';
10789
10789
  }
@@ -11288,25 +11288,30 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11288
11288
  this.hiddenElement.innerHTML = '';
11289
11289
  }
11290
11290
  if (!isNullOrUndefined(this.value)) {
11291
- for (let index = 0; !isNullOrUndefined(this.value[index]); index++) {
11292
- const listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
11291
+ let valueLength = this.value.length;
11292
+ let hiddenElementContent = '';
11293
+ for (let index = 0; index < valueLength; index++) {
11294
+ const valueItem = this.value[index];
11295
+ const listValue = this.findListElement((!isNullOrUndefined(this.mainList) ? this.mainList : this.ulElement), 'li', 'data-value', valueItem);
11293
11296
  if (isNullOrUndefined(listValue) && !this.allowCustomValue) {
11294
11297
  this.value.splice(index, 1);
11295
11298
  index -= 1;
11299
+ valueLength -= 1;
11296
11300
  }
11297
11301
  else {
11298
11302
  if (this.listData) {
11299
- temp = this.getTextByValue(this.value[index]);
11303
+ temp = this.getTextByValue(valueItem);
11300
11304
  }
11301
11305
  else {
11302
- temp = this.value[index];
11306
+ temp = valueItem;
11303
11307
  }
11304
11308
  data += temp + delimiterChar + ' ';
11305
11309
  text.push(temp);
11306
11310
  }
11307
- if (!isNullOrUndefined(this.hiddenElement)) {
11308
- this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11309
- }
11311
+ hiddenElementContent += `<option selected value="${valueItem}">${index}</option>`;
11312
+ }
11313
+ if (!isNullOrUndefined(this.hiddenElement)) {
11314
+ this.hiddenElement.innerHTML = hiddenElementContent;
11310
11315
  }
11311
11316
  }
11312
11317
  this.setProperties({ text: text.toString() }, true);