@syncfusion/ej2-dropdowns 20.3.58 → 20.3.59

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.
@@ -851,18 +851,20 @@ let DropDownBase = class DropDownBase extends Component {
851
851
  return extend({}, options, fields, true);
852
852
  }
853
853
  setFloatingHeader(e) {
854
- if (isNullOrUndefined(this.fixedHeaderElement)) {
855
- this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
856
- if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
857
- this.fixedHeaderElement.style.display = 'none';
854
+ if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
855
+ if (isNullOrUndefined(this.fixedHeaderElement)) {
856
+ this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
857
+ if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
858
+ this.fixedHeaderElement.style.display = 'none';
859
+ }
860
+ prepend([this.fixedHeaderElement], this.list);
861
+ this.setFixedHeader();
858
862
  }
859
- prepend([this.fixedHeaderElement], this.list);
860
- this.setFixedHeader();
861
- }
862
- if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
863
- this.setFixedHeader();
863
+ if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
864
+ this.setFixedHeader();
865
+ }
866
+ this.scrollStop(e);
864
867
  }
865
- this.scrollStop(e);
866
868
  }
867
869
  scrollStop(e) {
868
870
  let target = !isNullOrUndefined(e) ? e.target : this.list;
@@ -7612,7 +7614,7 @@ let ComboBox = class ComboBox extends DropDownList {
7612
7614
  this.itemData = this.getDataByValue(this.value);
7613
7615
  const dataItem = this.getItemData();
7614
7616
  if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
7615
- this.setProperties({ 'value': dataItem.value, 'text': dataItem.text }, !this.allowCustom);
7617
+ this.setProperties({ 'value': dataItem.value }, !this.allowCustom);
7616
7618
  }
7617
7619
  }
7618
7620
  /**
@@ -14524,12 +14526,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14524
14526
  if (li && li.parentElement) {
14525
14527
  currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
14526
14528
  if (!this.selectionSettings.showCheckbox) {
14527
- if ((e.ctrlKey || Browser.isDevice) && this.isSelected(li)) {
14529
+ if ((e.ctrlKey || e.metaKey || Browser.isDevice) && this.isSelected(li)) {
14528
14530
  li.classList.remove(cssClass.selected);
14529
14531
  li.removeAttribute('aria-selected');
14530
14532
  isSelect = false;
14531
14533
  }
14532
- else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || Browser.isDevice))) {
14534
+ else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || e.metaKey || Browser.isDevice))) {
14533
14535
  this.getSelectedItems().forEach((ele) => {
14534
14536
  ele.removeAttribute('aria-selected');
14535
14537
  });
@@ -14995,12 +14997,21 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14995
14997
  }
14996
14998
  return listObj;
14997
14999
  }
14998
- getGrabbedItems() {
15000
+ getGrabbedItems(args) {
15001
+ let grabbItems = false;
14999
15002
  for (let i = 0; i < this.value.length; i++) {
15000
- const liColl = this.list.querySelectorAll('[aria-selected="true"]');
15001
- for (let j = 0; j < liColl.length; j++) {
15002
- if (this.value[i] === liColl[j].textContent) {
15003
- liColl[j].classList.add('e-grabbed');
15003
+ if (this.value[i] === this.getFormattedValue(args.target.getAttribute('data-value'))) {
15004
+ grabbItems = true;
15005
+ break;
15006
+ }
15007
+ }
15008
+ if (grabbItems) {
15009
+ for (let i = 0; i < this.value.length; i++) {
15010
+ const liColl = this.list.querySelectorAll('[aria-selected="true"]');
15011
+ for (let j = 0; j < liColl.length; j++) {
15012
+ if (this.value[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
15013
+ liColl[j].classList.add('e-grabbed');
15014
+ }
15004
15015
  }
15005
15016
  }
15006
15017
  }
@@ -15014,7 +15025,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15014
15025
  return elems;
15015
15026
  }
15016
15027
  getDragArgs(args, isDragEnd) {
15017
- let elems = this.getGrabbedItems();
15028
+ let elems = this.getGrabbedItems(args);
15018
15029
  if (elems.length) {
15019
15030
  if (isDragEnd) {
15020
15031
  elems.push(args.target);