@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.
@@ -18333,6 +18333,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18333
18333
  _this.initializePopup(popupEle_1, offsetValue, left);
18334
18334
  _this.checkCollision(popupEle_1);
18335
18335
  popupEle_1.style.visibility = 'visible';
18336
+ var popupLeft_1 = popupEle_1.parentElement.offsetWidth - popupEle_1.offsetWidth;
18337
+ var popupHeight_1 = popupEle_1.offsetHeight;
18336
18338
  addClass([popupEle_1], ['e-mention', 'e-popup', 'e-popup-close']);
18337
18339
  if (!isNullOrUndefined(_this.list)) {
18338
18340
  _this.unWireListEvents();
@@ -18361,9 +18363,23 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18361
18363
  popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(coordinates_1.left.toString(), 'px;\nposition: absolute;\n display: block;');
18362
18364
  }
18363
18365
  else {
18364
- popupEle_1.style.left = formatUnit(coordinates_1.left);
18365
- popupEle_1.style.top = formatUnit(coordinates_1.top - parseInt(_this.popupHeight.toString()));
18366
+ if (_this.collision.length > 0 && _this.collision.indexOf('right') > -1 && _this.collision.indexOf('bottom') === -1) {
18367
+ popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(popupLeft_1.toString(), 'px;\nposition: absolute;\n display: block;');
18368
+ }
18369
+ else if (_this.collision && _this.collision.length > 0 && _this.collision.indexOf('bottom') > -1 && _this.collision.indexOf('right') === -1) {
18370
+ popupEle_1.style.left = formatUnit(coordinates_1.left);
18371
+ popupEle_1.style.top = formatUnit(coordinates_1.top - parseInt(popupHeight_1.toString()));
18372
+ }
18373
+ else if (_this.collision && _this.collision.length > 0 && _this.collision.indexOf('bottom') > -1 && _this.collision.indexOf('right') > -1) {
18374
+ popupEle_1.style.left = formatUnit(popupLeft_1);
18375
+ popupEle_1.style.top = formatUnit(coordinates_1.top - parseInt(popupHeight_1.toString()));
18376
+ }
18377
+ else {
18378
+ popupEle_1.style.left = formatUnit(coordinates_1.left);
18379
+ popupEle_1.style.top = formatUnit(coordinates_1.top - parseInt(_this.popupHeight.toString()));
18380
+ }
18366
18381
  _this.isCollided = false;
18382
+ _this.collision = [];
18367
18383
  }
18368
18384
  popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
18369
18385
  _this.setHeight(popupEle_1);
@@ -18392,8 +18408,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18392
18408
  Mention.prototype.checkCollision = function (popupEle) {
18393
18409
  if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
18394
18410
  var coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
18395
- var collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
18396
- if (collision.length > 0) {
18411
+ this.collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
18412
+ if (this.collision.length > 0) {
18397
18413
  popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
18398
18414
  this.isCollided = true;
18399
18415
  }
@@ -18528,10 +18544,18 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18528
18544
  document.body.removeChild(div);
18529
18545
  }
18530
18546
  else {
18531
- coordinates = {
18532
- top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
18533
- left: rect.left + windowLeft + width
18534
- };
18547
+ if (this.collision && this.collision.length > 0 && this.collision.indexOf('right') > -1 && this.collision.indexOf('bottom') === -1) {
18548
+ coordinates = {
18549
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
18550
+ left: rect.left + windowLeft + width
18551
+ };
18552
+ }
18553
+ else {
18554
+ coordinates = {
18555
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
18556
+ left: rect.left + windowLeft + width
18557
+ };
18558
+ }
18535
18559
  }
18536
18560
  return coordinates;
18537
18561
  };