@syncfusion/ej2-dropdowns 23.1.41 → 23.1.42

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.
@@ -18010,6 +18010,8 @@ let Mention = class Mention extends DropDownBase {
18010
18010
  this.initializePopup(popupEle, offsetValue, left);
18011
18011
  this.checkCollision(popupEle);
18012
18012
  popupEle.style.visibility = 'visible';
18013
+ let popupLeft = popupEle.parentElement.offsetWidth - popupEle.offsetWidth;
18014
+ let popupHeight = popupEle.offsetHeight;
18013
18015
  addClass([popupEle], ['e-mention', 'e-popup', 'e-popup-close']);
18014
18016
  if (!isNullOrUndefined(this.list)) {
18015
18017
  this.unWireListEvents();
@@ -18038,9 +18040,23 @@ let Mention = class Mention extends DropDownBase {
18038
18040
  popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(coordinates.left.toString(), 'px;\nposition: absolute;\n display: block;');
18039
18041
  }
18040
18042
  else {
18041
- popupEle.style.left = formatUnit(coordinates.left);
18042
- popupEle.style.top = formatUnit(coordinates.top - parseInt(this.popupHeight.toString()));
18043
+ if (this.collision.length > 0 && this.collision.indexOf('right') > -1 && this.collision.indexOf('bottom') === -1) {
18044
+ popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(popupLeft.toString(), 'px;\nposition: absolute;\n display: block;');
18045
+ }
18046
+ else if (this.collision && this.collision.length > 0 && this.collision.indexOf('bottom') > -1 && this.collision.indexOf('right') === -1) {
18047
+ popupEle.style.left = formatUnit(coordinates.left);
18048
+ popupEle.style.top = formatUnit(coordinates.top - parseInt(popupHeight.toString()));
18049
+ }
18050
+ else if (this.collision && this.collision.length > 0 && this.collision.indexOf('bottom') > -1 && this.collision.indexOf('right') > -1) {
18051
+ popupEle.style.left = formatUnit(popupLeft);
18052
+ popupEle.style.top = formatUnit(coordinates.top - parseInt(popupHeight.toString()));
18053
+ }
18054
+ else {
18055
+ popupEle.style.left = formatUnit(coordinates.left);
18056
+ popupEle.style.top = formatUnit(coordinates.top - parseInt(this.popupHeight.toString()));
18057
+ }
18043
18058
  this.isCollided = false;
18059
+ this.collision = [];
18044
18060
  }
18045
18061
  popupEle.style.width = this.popupWidth !== '100%' && !isNullOrUndefined(this.popupWidth) ? formatUnit(this.popupWidth) : 'auto';
18046
18062
  this.setHeight(popupEle);
@@ -18069,8 +18085,8 @@ let Mention = class Mention extends DropDownBase {
18069
18085
  checkCollision(popupEle) {
18070
18086
  if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
18071
18087
  let coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
18072
- const collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
18073
- if (collision.length > 0) {
18088
+ this.collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
18089
+ if (this.collision.length > 0) {
18074
18090
  popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
18075
18091
  this.isCollided = true;
18076
18092
  }
@@ -18204,10 +18220,18 @@ let Mention = class Mention extends DropDownBase {
18204
18220
  document.body.removeChild(div);
18205
18221
  }
18206
18222
  else {
18207
- coordinates = {
18208
- top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
18209
- left: rect.left + windowLeft + width
18210
- };
18223
+ if (this.collision && this.collision.length > 0 && this.collision.indexOf('right') > -1 && this.collision.indexOf('bottom') === -1) {
18224
+ coordinates = {
18225
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
18226
+ left: rect.left + windowLeft + width
18227
+ };
18228
+ }
18229
+ else {
18230
+ coordinates = {
18231
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
18232
+ left: rect.left + windowLeft + width
18233
+ };
18234
+ }
18211
18235
  }
18212
18236
  return coordinates;
18213
18237
  }