@syncfusion/ej2-dropdowns 20.4.50 → 20.4.52

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.
@@ -2079,7 +2079,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2079
2079
  }
2080
2080
  if (!this.readonly) {
2081
2081
  const isTabAction = e.action === 'tab' || e.action === 'close';
2082
- if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
2082
+ if (isNullOrUndefined(this.list) && !this.isRequested && !isTabAction && e.action !== 'escape') {
2083
2083
  this.searchKeyEvent = e;
2084
2084
  this.renderList(e);
2085
2085
  }
@@ -5134,7 +5134,9 @@ let DropDownTree = class DropDownTree extends Component {
5134
5134
  this.clickHandler(e);
5135
5135
  break;
5136
5136
  case 'moveDown':
5137
- this.treeObj.element.focus();
5137
+ let focusedElement = this.treeObj.element.querySelector('li');
5138
+ focusedElement.focus();
5139
+ addClass([focusedElement], ['e-hover', 'e-node-focus']);
5138
5140
  }
5139
5141
  }
5140
5142
  });
@@ -5807,7 +5809,9 @@ let DropDownTree = class DropDownTree extends Component {
5807
5809
  this.popupObj.refreshPosition();
5808
5810
  if (!(this.showCheckBox && this.showSelectAll) && (!this.popupDiv.classList.contains(NODATA)
5809
5811
  && this.treeItems.length > 0)) {
5810
- this.treeObj.element.focus();
5812
+ let focusedElement = this.treeObj.element.querySelector('li');
5813
+ focusedElement.focus();
5814
+ addClass([focusedElement], ['e-hover', 'e-node-focus']);
5811
5815
  }
5812
5816
  if (this.checkSelectAll && this.checkBoxElement) {
5813
5817
  const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
@@ -9727,11 +9731,25 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9727
9731
  }
9728
9732
  this.checkPlaceholderSize();
9729
9733
  Input.createSpanElement(this.overAllWrapper, this.createElement);
9730
- Input.calculateWidth(this.inputElement, this.overAllWrapper);
9734
+ this.calculateWidth();
9731
9735
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
9732
9736
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
9733
9737
  }
9734
9738
  }
9739
+ calculateWidth() {
9740
+ let elementWidth;
9741
+ if (this.overAllWrapper) {
9742
+ if (!this.showDropDownIcon || this.overAllWrapper.querySelector('.' + 'e-label-top')) {
9743
+ elementWidth = this.overAllWrapper.clientWidth - 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight));
9744
+ }
9745
+ else {
9746
+ var downIconWidth = this.dropIcon.offsetWidth +
9747
+ parseInt(getComputedStyle(this.dropIcon).marginRight);
9748
+ elementWidth = this.overAllWrapper.clientWidth - (downIconWidth + 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight)));
9749
+ }
9750
+ Input.calculateWidth(elementWidth, this.overAllWrapper, this.getModuleName());
9751
+ }
9752
+ }
9735
9753
  checkPlaceholderSize() {
9736
9754
  if (this.showDropDownIcon) {
9737
9755
  const downIconWidth = this.dropIcon.offsetWidth +
@@ -9868,7 +9886,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9868
9886
  if (this.isPopupOpen()) {
9869
9887
  this.refreshPopup();
9870
9888
  }
9871
- Input.calculateWidth(this.inputElement, this.overAllWrapper);
9889
+ setTimeout(() => {
9890
+ this.calculateWidth();
9891
+ }, 150);
9872
9892
  return true;
9873
9893
  }
9874
9894
  else {
@@ -12363,7 +12383,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12363
12383
  case 'cssClass':
12364
12384
  this.updateOldPropCssClass(oldProp.cssClass);
12365
12385
  this.updateCssClass();
12366
- Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12386
+ this.calculateWidth();
12367
12387
  break;
12368
12388
  case 'enableRtl':
12369
12389
  this.enableRTL(newProp.enableRtl);
@@ -12391,7 +12411,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12391
12411
  this.setFloatLabelType();
12392
12412
  this.addValidInputClass();
12393
12413
  Input.createSpanElement(this.overAllWrapper, this.createElement);
12394
- Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12414
+ this.calculateWidth();
12395
12415
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12396
12416
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12397
12417
  }
@@ -12737,7 +12757,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12737
12757
  this.element.setAttribute('data-val', 'false');
12738
12758
  }
12739
12759
  Input.createSpanElement(this.overAllWrapper, this.createElement);
12740
- Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12760
+ this.calculateWidth();
12741
12761
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12742
12762
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12743
12763
  }
@@ -16504,7 +16524,6 @@ let Mention = class Mention extends DropDownBase {
16504
16524
  }
16505
16525
  if (!isNullOrUndefined(this.target)) {
16506
16526
  popupEle.id = this.inputElement.id + '_popup';
16507
- addClass([popupEle], ['e-mention', 'e-popup', 'e-popup-close']);
16508
16527
  }
16509
16528
  this.listHeight = formatUnit(this.popupHeight);
16510
16529
  if (!isNullOrUndefined(this.list.querySelector('li')) && !this.initRemoteRender) {
@@ -16528,6 +16547,7 @@ let Mention = class Mention extends DropDownBase {
16528
16547
  this.initializePopup(popupEle, offsetValue, left);
16529
16548
  this.checkCollision(popupEle);
16530
16549
  popupEle.style.visibility = 'visible';
16550
+ addClass([popupEle], ['e-mention', 'e-popup', 'e-popup-close']);
16531
16551
  if (!isNullOrUndefined(this.list)) {
16532
16552
  this.unWireListEvents();
16533
16553
  this.wireListEvents();
@@ -16554,6 +16574,7 @@ let Mention = class Mention extends DropDownBase {
16554
16574
  }
16555
16575
  else {
16556
16576
  popupEle.style.left = formatUnit(coordinates.left);
16577
+ popupEle.style.top = formatUnit(coordinates.top - parseInt(this.popupHeight.toString()));
16557
16578
  this.isCollided = false;
16558
16579
  }
16559
16580
  popupEle.style.width = this.popupWidth !== '100%' && !isNullOrUndefined(this.popupWidth) ? formatUnit(this.popupWidth) : 'auto';
@@ -16582,7 +16603,8 @@ let Mention = class Mention extends DropDownBase {
16582
16603
  }
16583
16604
  checkCollision(popupEle) {
16584
16605
  if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
16585
- const collision = isCollide(popupEle);
16606
+ let coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
16607
+ const collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
16586
16608
  if (collision.length > 0) {
16587
16609
  popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
16588
16610
  this.isCollided = true;
@@ -16606,7 +16628,7 @@ let Mention = class Mention extends DropDownBase {
16606
16628
  this.popupObj = new Popup(element, {
16607
16629
  width: this.setWidth(), targetType: 'relative',
16608
16630
  relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
16609
- enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
16631
+ enableRtl: this.enableRtl, offsetX: left, position: { X: 'left', Y: 'bottom' }, actionOnScroll: 'hide',
16610
16632
  zIndex: this.zIndex,
16611
16633
  close: () => {
16612
16634
  this.destroyPopup();
@@ -16688,14 +16710,14 @@ let Mention = class Mention extends DropDownBase {
16688
16710
  if (!this.isContentEditable(this.inputElement)) {
16689
16711
  coordinates = {
16690
16712
  top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
16691
- parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
16713
+ parseInt(computed.fontSize, 10) + 3 - element.scrollTop - (this.isCollided ? 10 : 0),
16692
16714
  left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
16693
16715
  };
16694
16716
  document.body.removeChild(div);
16695
16717
  }
16696
16718
  else {
16697
16719
  coordinates = {
16698
- top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
16720
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
16699
16721
  left: rect.left + windowLeft
16700
16722
  };
16701
16723
  }