@syncfusion/ej2-dropdowns 21.2.4 → 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
  });
@@ -427,6 +427,9 @@ let DropDownBase = class DropDownBase extends Component {
427
427
  ele.appendChild(noDataCompTemp[i]);
428
428
  }
429
429
  }
430
+ else {
431
+ ele.appendChild(noDataCompTemp[i]);
432
+ }
430
433
  }
431
434
  }
432
435
  this.renderReactTemplates();
@@ -2601,6 +2604,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2601
2604
  const index = this.isSelectCustom ? null : this.activeIndex;
2602
2605
  this.setProperties({ 'index': index, 'text': dataItem.text, 'value': dataItem.value }, true);
2603
2606
  this.detachChangeEvent(eve);
2607
+ this.dispatchEvent(this.hiddenElement, 'change');
2604
2608
  }
2605
2609
  detachChanges(value) {
2606
2610
  let items;
@@ -3271,7 +3275,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3271
3275
  this.isNotSearchList = false;
3272
3276
  this.isDocumentClick = false;
3273
3277
  this.destroyPopup();
3274
- EventHandler.remove(document, 'mousedown', this.onDocumentClick);
3275
3278
  if (this.isFiltering() && this.actionCompleteData.list && this.actionCompleteData.list[0]) {
3276
3279
  this.isActive = true;
3277
3280
  this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
@@ -10777,10 +10780,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10777
10780
  }
10778
10781
  }
10779
10782
  removeChipFocus() {
10780
- const elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1);
10781
- const closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
10783
+ const elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1 + '.' + CHIP_SELECTED);
10782
10784
  removeClass(elements, CHIP_SELECTED);
10783
10785
  if (Browser.isDevice) {
10786
+ const closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
10784
10787
  for (let index = 0; index < closeElements.length; index++) {
10785
10788
  closeElements[index].style.display = 'none';
10786
10789
  }
@@ -11285,25 +11288,30 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11285
11288
  this.hiddenElement.innerHTML = '';
11286
11289
  }
11287
11290
  if (!isNullOrUndefined(this.value)) {
11288
- for (let index = 0; !isNullOrUndefined(this.value[index]); index++) {
11289
- 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);
11290
11296
  if (isNullOrUndefined(listValue) && !this.allowCustomValue) {
11291
11297
  this.value.splice(index, 1);
11292
11298
  index -= 1;
11299
+ valueLength -= 1;
11293
11300
  }
11294
11301
  else {
11295
11302
  if (this.listData) {
11296
- temp = this.getTextByValue(this.value[index]);
11303
+ temp = this.getTextByValue(valueItem);
11297
11304
  }
11298
11305
  else {
11299
- temp = this.value[index];
11306
+ temp = valueItem;
11300
11307
  }
11301
11308
  data += temp + delimiterChar + ' ';
11302
11309
  text.push(temp);
11303
11310
  }
11304
- if (!isNullOrUndefined(this.hiddenElement)) {
11305
- this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11306
- }
11311
+ hiddenElementContent += `<option selected value="${valueItem}">${index}</option>`;
11312
+ }
11313
+ if (!isNullOrUndefined(this.hiddenElement)) {
11314
+ this.hiddenElement.innerHTML = hiddenElementContent;
11307
11315
  }
11308
11316
  }
11309
11317
  this.setProperties({ text: text.toString() }, true);