@syncfusion/ej2-dropdowns 32.2.7 → 32.2.8

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.
@@ -368,7 +368,7 @@ class VirtualScroll {
368
368
  if (this.component === 'combobox') {
369
369
  let totalData = 0;
370
370
  if (this.parent.dataSource instanceof DataManager) {
371
- totalData = this.parent.remoteDataCount;
371
+ totalData = this.parent.dataSource.dataSource.json.length;
372
372
  }
373
373
  else if (this.parent.dataSource && this.parent.dataSource.length > 0) {
374
374
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5679,7 +5679,8 @@ let DropDownList = class DropDownList extends DropDownBase {
5679
5679
  this.setFooterTemplate(popupEle);
5680
5680
  this.isUpdateFooterHeight = this.footer.offsetHeight !== 0;
5681
5681
  }
5682
- document.body.appendChild(popupEle);
5682
+ const appendToElement = this.getAppendToElement();
5683
+ appendToElement.appendChild(popupEle);
5683
5684
  popupEle.style.top = '0px';
5684
5685
  initialPopupHeight = popupEle.clientHeight;
5685
5686
  if (this.enableVirtualization && (this.itemTemplate || this.isAngular)) {
@@ -5940,6 +5941,16 @@ let DropDownList = class DropDownList extends DropDownBase {
5940
5941
  }
5941
5942
  });
5942
5943
  }
5944
+ getAppendToElement() {
5945
+ if (this.isAngular) {
5946
+ const cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
5947
+ const popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
5948
+ if (cdkPane && popoverEl) {
5949
+ return cdkPane;
5950
+ }
5951
+ }
5952
+ return document.body;
5953
+ }
5943
5954
  checkCollision(popupEle) {
5944
5955
  if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'dropdownlist' || this.isDropDownClick))) {
5945
5956
  const collision = isCollide(popupEle);
@@ -6705,7 +6716,8 @@ let DropDownList = class DropDownList extends DropDownBase {
6705
6716
  const listParentHeight = formatUnit(this.popupHeight);
6706
6717
  listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
6707
6718
  listParent.appendChild(item);
6708
- document.body.appendChild(listParent);
6719
+ const appendToElement = this.getAppendToElement();
6720
+ appendToElement.appendChild(listParent);
6709
6721
  this.virtualListHeight = listParent.getBoundingClientRect().height;
6710
6722
  const listItemHeight = Math.ceil(item.getBoundingClientRect().height) +
6711
6723
  parseInt(window.getComputedStyle(item).marginBottom, 10);