@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_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
  });
@@ -2656,6 +2656,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2656
2656
  var index = this.isSelectCustom ? null : this.activeIndex;
2657
2657
  this.setProperties({ 'index': index, 'text': dataItem.text, 'value': dataItem.value }, true);
2658
2658
  this.detachChangeEvent(eve);
2659
+ this.dispatchEvent(this.hiddenElement, 'change');
2659
2660
  };
2660
2661
  DropDownList.prototype.detachChanges = function (value) {
2661
2662
  var items;
@@ -3336,7 +3337,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3336
3337
  _this.isNotSearchList = false;
3337
3338
  _this.isDocumentClick = false;
3338
3339
  _this.destroyPopup();
3339
- EventHandler.remove(document, 'mousedown', _this.onDocumentClick);
3340
3340
  if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {
3341
3341
  _this.isActive = true;
3342
3342
  _this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
@@ -10947,10 +10947,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10947
10947
  }
10948
10948
  };
10949
10949
  MultiSelect.prototype.removeChipFocus = function () {
10950
- var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1);
10951
- var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
10950
+ var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1 + '.' + CHIP_SELECTED);
10952
10951
  removeClass(elements, CHIP_SELECTED);
10953
10952
  if (Browser.isDevice) {
10953
+ var closeElements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP_CLOSE$1.split(' ')[0]);
10954
10954
  for (var index = 0; index < closeElements.length; index++) {
10955
10955
  closeElements[index].style.display = 'none';
10956
10956
  }
@@ -11459,25 +11459,30 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11459
11459
  this.hiddenElement.innerHTML = '';
11460
11460
  }
11461
11461
  if (!isNullOrUndefined(this.value)) {
11462
- for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
11463
- 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);
11464
11467
  if (isNullOrUndefined(listValue) && !this.allowCustomValue) {
11465
11468
  this.value.splice(index, 1);
11466
11469
  index -= 1;
11470
+ valueLength -= 1;
11467
11471
  }
11468
11472
  else {
11469
11473
  if (this.listData) {
11470
- temp = this.getTextByValue(this.value[index]);
11474
+ temp = this.getTextByValue(valueItem);
11471
11475
  }
11472
11476
  else {
11473
- temp = this.value[index];
11477
+ temp = valueItem;
11474
11478
  }
11475
11479
  data += temp + delimiterChar + ' ';
11476
11480
  text.push(temp);
11477
11481
  }
11478
- if (!isNullOrUndefined(this.hiddenElement)) {
11479
- this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11480
- }
11482
+ hiddenElementContent += "<option selected value=\"" + valueItem + "\">" + index + "</option>";
11483
+ }
11484
+ if (!isNullOrUndefined(this.hiddenElement)) {
11485
+ this.hiddenElement.innerHTML = hiddenElementContent;
11481
11486
  }
11482
11487
  }
11483
11488
  this.setProperties({ text: text.toString() }, true);