@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_1).forEach(function (value) {
101
101
  /* eslint-disable security/detect-object-injection */
102
- if (type === 'object' && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && checkField_1.getAttribute('data-value') === data[fields.value].toString() || type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1) {
102
+ if (type === 'object' && (!data.isHeader && checkField_1.textContent.toString().indexOf(data[value]) !== -1) && checkField_1.getAttribute('data-value') === data[fields.value].toString() || type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1) {
103
103
  filterValue = type === 'object' ? data[value] : data;
104
104
  }
105
105
  });
@@ -454,6 +454,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
454
454
  ele.appendChild(noDataCompTemp[i]);
455
455
  }
456
456
  }
457
+ else {
458
+ ele.appendChild(noDataCompTemp[i]);
459
+ }
457
460
  }
458
461
  }
459
462
  this.renderReactTemplates();
@@ -2653,6 +2656,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2653
2656
  var index = this.isSelectCustom ? null : this.activeIndex;
2654
2657
  this.setProperties({ 'index': index, 'text': dataItem.text, 'value': dataItem.value }, true);
2655
2658
  this.detachChangeEvent(eve);
2659
+ this.dispatchEvent(this.hiddenElement, 'change');
2656
2660
  };
2657
2661
  DropDownList.prototype.detachChanges = function (value) {
2658
2662
  var items;
@@ -3333,7 +3337,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3333
3337
  _this.isNotSearchList = false;
3334
3338
  _this.isDocumentClick = false;
3335
3339
  _this.destroyPopup();
3336
- EventHandler.remove(document, 'mousedown', _this.onDocumentClick);
3337
3340
  if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {
3338
3341
  _this.isActive = true;
3339
3342
  _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
@@ -10944,10 +10947,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10944
10947
  }
10945
10948
  };
10946
10949
  MultiSelect.prototype.removeChipFocus = function () {
10947
- var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1);
10948
- var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
10950
+ var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1 + '.' + CHIP_SELECTED);
10949
10951
  removeClass(elements, CHIP_SELECTED);
10950
10952
  if (Browser.isDevice) {
10953
+ var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
10951
10954
  for (var index = 0; index < closeElements.length; index++) {
10952
10955
  closeElements[index].style.display = 'none';
10953
10956
  }
@@ -11456,25 +11459,30 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11456
11459
  this.hiddenElement.innerHTML = '';
11457
11460
  }
11458
11461
  if (!isNullOrUndefined(this.value)) {
11459
- for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
11460
- var listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
11462
+ var valueLength = this.value.length;
11463
+ var hiddenElementContent = '';
11464
+ for (var index = 0; index < valueLength; index++) {
11465
+ var valueItem = this.value[index];
11466
+ var listValue = this.findListElement((!isNullOrUndefined(this.mainList) ? this.mainList : this.ulElement), 'li', 'data-value', valueItem);
11461
11467
  if (isNullOrUndefined(listValue) && !this.allowCustomValue) {
11462
11468
  this.value.splice(index, 1);
11463
11469
  index -= 1;
11470
+ valueLength -= 1;
11464
11471
  }
11465
11472
  else {
11466
11473
  if (this.listData) {
11467
- temp = this.getTextByValue(this.value[index]);
11474
+ temp = this.getTextByValue(valueItem);
11468
11475
  }
11469
11476
  else {
11470
- temp = this.value[index];
11477
+ temp = valueItem;
11471
11478
  }
11472
11479
  data += temp + delimiterChar + ' ';
11473
11480
  text.push(temp);
11474
11481
  }
11475
- if (!isNullOrUndefined(this.hiddenElement)) {
11476
- this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11477
- }
11482
+ hiddenElementContent += "<option selected value=\"" + valueItem + "\">" + index + "</option>";
11483
+ }
11484
+ if (!isNullOrUndefined(this.hiddenElement)) {
11485
+ this.hiddenElement.innerHTML = hiddenElementContent;
11478
11486
  }
11479
11487
  }
11480
11488
  this.setProperties({ text: text.toString() }, true);