@syncfusion/ej2-dropdowns 35.1.42 → 35.1.46

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.
@@ -461,7 +461,9 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
461
461
  this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement);
462
462
  }
463
463
  this.parent.updateVirtualReOrderList(true);
464
- if (this.parent.value.length < this.parent.itemCount && this.parent.value.length !== this.parent.totalItemCount) {
464
+ var totalCount = this.parent.dataSource instanceof DataManager
465
+ ? this.parent.totalItemCount : this.parent.dataSource.length;
466
+ if (this.parent.value.length < this.parent.itemCount && this.parent.value.length !== totalCount) {
465
467
  var oldUlElement_1 = this.parent.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
466
468
  if (oldUlElement_1) {
467
469
  this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement_1);
@@ -3644,8 +3646,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3644
3646
  'aria-disabled': 'false',
3645
3647
  'role': 'combobox',
3646
3648
  'aria-expanded': 'false',
3647
- 'aria-live': 'polite',
3648
- 'aria-labelledby': this.hiddenElement.id
3649
+ 'aria-live': 'polite'
3649
3650
  };
3650
3651
  };
3651
3652
  DropDownList.prototype.setEnableRtl = function () {
@@ -6967,6 +6968,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6967
6968
  if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
6968
6969
  this.inputElement.setAttribute('type', 'text');
6969
6970
  }
6971
+ if (this.getModuleName() === 'dropdownlist') {
6972
+ this.inputElement.setAttribute('aria-label', this.getModuleName());
6973
+ }
6970
6974
  this.inputElement.setAttribute('aria-expanded', 'false');
6971
6975
  }
6972
6976
  else {
@@ -7053,7 +7057,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7053
7057
  if (!this.targetElement().hasAttribute('aria-label')) {
7054
7058
  attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
7055
7059
  }
7056
- if (!this.inputElement.hasAttribute('aria-labelledby')) {
7060
+ if (this.getModuleName() !== 'dropdownlist' && !this.inputElement.hasAttribute('aria-labelledby')) {
7057
7061
  this.inputElement.setAttribute('aria-labelledby', this.hiddenElement.id);
7058
7062
  }
7059
7063
  this.inputElement.setAttribute('aria-expanded', 'false');
@@ -7061,9 +7065,19 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7061
7065
  attributes(this.targetElement(), this.getAriaAttributes());
7062
7066
  this.updateDataAttribute(this.htmlAttributes);
7063
7067
  this.setHTMLAttributes();
7064
- if (this.targetElement() === this.inputElement) {
7068
+ if (this.getModuleName() !== 'dropdownlist' && this.targetElement() === this.inputElement) {
7065
7069
  this.inputElement.removeAttribute('aria-labelledby');
7066
7070
  }
7071
+ if (this.getModuleName() === 'dropdownlist' && this.targetElement() === this.inputWrapper.container) {
7072
+ var floatLabel = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
7073
+ if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabel)) {
7074
+ floatLabel.id = 'label_' + this.element.id.replace(/ /g, '_');
7075
+ attributes(this.inputWrapper.container, { 'aria-labelledby': floatLabel.id });
7076
+ }
7077
+ else {
7078
+ this.inputWrapper.container.removeAttribute('aria-labelledby');
7079
+ }
7080
+ }
7067
7081
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
7068
7082
  if (this.enableVirtualization) {
7069
7083
  this.listItemHeight = this.getListHeight();
@@ -7122,7 +7136,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7122
7136
  var floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
7123
7137
  if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
7124
7138
  floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
7125
- attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
7139
+ attributes(this.getModuleName() === 'dropdownlist'
7140
+ ? this.inputWrapper.container
7141
+ : this.inputElement, { 'aria-labelledby': floatLabelElement.id });
7142
+ if (this.getModuleName() === 'dropdownlist' && this.inputElement) {
7143
+ this.inputElement.removeAttribute('aria-labelledby');
7144
+ }
7126
7145
  }
7127
7146
  this.renderComplete();
7128
7147
  this.listItemHeight = this.getListHeight();
@@ -7339,7 +7358,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7339
7358
  if (label) {
7340
7359
  label.remove();
7341
7360
  }
7342
- this_1.inputElement.removeAttribute('aria-labelledby');
7361
+ this_1.inputWrapper.container.removeAttribute('aria-labelledby');
7343
7362
  }
7344
7363
  else if (this_1.floatLabelType !== 'Never' && !this_1.value) {
7345
7364
  var floatLabel = this_1.inputWrapper.container
@@ -7371,7 +7390,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7371
7390
  }
7372
7391
  floatLabel.style.width = this_1.inputElement.offsetWidth + 'px';
7373
7392
  floatLabel.textContent = newProp.placeholder;
7374
- this_1.inputElement.setAttribute('aria-labelledby', floatLabel.id);
7393
+ this_1.inputWrapper.container.setAttribute('aria-labelledby', floatLabel.id);
7375
7394
  }
7376
7395
  }
7377
7396
  break;
@@ -7584,14 +7603,28 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7584
7603
  this_1.updateSelectElementData(this_1.allowFiltering);
7585
7604
  }
7586
7605
  break;
7587
- case 'floatLabelType':
7606
+ case 'floatLabelType': {
7588
7607
  Input.removeFloating(this_1.inputWrapper);
7589
7608
  Input.addFloating(this_1.inputElement, newProp.floatLabelType, this_1.placeholder, this_1.createElement);
7590
7609
  if (!isNullOrUndefined(this_1.inputWrapper.buttons[0]) &&
7591
7610
  this_1.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0] && this_1.floatLabelType !== 'Never') {
7592
7611
  this_1.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
7593
7612
  }
7613
+ if (this_1.getModuleName() === 'dropdownlist') {
7614
+ var floatLabelElement = this_1.inputWrapper.container.getElementsByClassName('e-float-text')[0];
7615
+ if (!isNullOrUndefined(this_1.element.id) &&
7616
+ this_1.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
7617
+ floatLabelElement.id = 'label_' + this_1.element.id.replace(/ /g, '_');
7618
+ attributes(this_1.inputWrapper.container, {
7619
+ 'aria-labelledby': floatLabelElement.id
7620
+ });
7621
+ }
7622
+ else {
7623
+ this_1.inputWrapper.container.removeAttribute('aria-labelledby');
7624
+ }
7625
+ }
7594
7626
  break;
7627
+ }
7595
7628
  case 'showClearButton':
7596
7629
  if (!this_1.inputWrapper.clearButton) {
7597
7630
  Input.setClearButton(newProp.showClearButton, this_1.inputElement, this_1.inputWrapper, null, this_1.createElement);
@@ -7700,7 +7733,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7700
7733
  }
7701
7734
  if (label && this.getModuleName() === 'dropdownlist' && (!this.placeholder || this.placeholder.trim() === '')) {
7702
7735
  label.remove();
7703
- this.inputElement.removeAttribute('aria-labelledby');
7736
+ this.inputWrapper.container.removeAttribute('aria-labelledby');
7704
7737
  }
7705
7738
  };
7706
7739
  /**