@syncfusion/ej2-dropdowns 20.2.44 → 20.2.48

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.
@@ -257,6 +257,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
257
257
  _this.isAngular = false;
258
258
  _this.isPreventChange = false;
259
259
  _this.isDynamicDataChange = false;
260
+ _this.addedNewItem = false;
260
261
  return _this;
261
262
  }
262
263
  DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
@@ -1059,7 +1060,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1059
1060
  dataSource = this.selectData;
1060
1061
  }
1061
1062
  }
1062
- dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
1063
+ dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length && this.addedNewItem ? this.selectData : dataSource;
1064
+ this.addedNewItem = false;
1063
1065
  this.setListData(dataSource, fields, query, e);
1064
1066
  }
1065
1067
  };
@@ -1317,6 +1319,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1317
1319
  if (selectedItemValue || itemIndex === 0) {
1318
1320
  this.updateSelection();
1319
1321
  }
1322
+ this.addedNewItem = true;
1320
1323
  };
1321
1324
  DropDownBase.prototype.validationAttribute = function (target, hidden) {
1322
1325
  var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
@@ -3504,14 +3507,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3504
3507
  if (this.element.tagName === 'INPUT') {
3505
3508
  this.inputElement = this.element;
3506
3509
  if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
3507
- this.inputElement.setAttribute('role', 'textbox');
3510
+ this.inputElement.setAttribute('role', 'combobox');
3508
3511
  }
3509
3512
  if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
3510
3513
  this.inputElement.setAttribute('type', 'text');
3511
3514
  }
3512
3515
  }
3513
3516
  else {
3514
- this.inputElement = this.createElement('input', { attrs: { role: 'textbox', type: 'text' } });
3517
+ this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
3515
3518
  if (this.element.tagName !== this.getNgDirective()) {
3516
3519
  this.element.style.display = 'none';
3517
3520
  }
@@ -3560,6 +3563,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3560
3563
  attributes(this.targetElement(), this.getAriaAttributes());
3561
3564
  this.updateDataAttribute(this.htmlAttributes);
3562
3565
  this.setHTMLAttributes();
3566
+ if (this.targetElement() === this.inputElement) {
3567
+ this.inputElement.removeAttribute('aria-labelledby');
3568
+ }
3563
3569
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
3564
3570
  this.initValue();
3565
3571
  }
@@ -3590,6 +3596,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3590
3596
  if (this.element.hasAttribute('data-val')) {
3591
3597
  this.element.setAttribute('data-val', 'false');
3592
3598
  }
3599
+ var floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
3600
+ if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
3601
+ floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
3602
+ attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
3603
+ }
3593
3604
  this.renderComplete();
3594
3605
  };
3595
3606
  DropDownList.prototype.setFooterTemplate = function (popupEle) {
@@ -8721,9 +8732,11 @@ var LABELBOTTOM = 'e-label-bottom';
8721
8732
  function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement, value, floatLabelType, placeholder) {
8722
8733
  var floatLinelement = createElement('span', { className: FLOATLINE });
8723
8734
  var floatLabelElement = createElement('label', { className: FLOATTEXT });
8735
+ var id = element.getAttribute('id') ? element.getAttribute('id') : getUniqueID('ej2_multiselect');
8736
+ element.id = id;
8724
8737
  if (!isNullOrUndefined(element.id) && element.id !== '') {
8725
8738
  floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
8726
- attributes(element, { 'aria-labelledby': floatLabelElement.id });
8739
+ attributes(inputElement, { 'aria-labelledby': floatLabelElement.id });
8727
8740
  }
8728
8741
  if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {
8729
8742
  floatLabelElement.innerText = encodePlaceholder(inputElement.placeholder);
@@ -12630,7 +12643,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12630
12643
  });
12631
12644
  if (this.mode === 'Default' || this.mode === 'Box') {
12632
12645
  this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
12633
- this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
12634
12646
  }
12635
12647
  if (this.element.tagName !== this.getNgDirective()) {
12636
12648
  this.element.style.display = 'none';