@syncfusion/ej2-dropdowns 35.2.12 → 35.2.15

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.
@@ -6848,6 +6848,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6848
6848
  _this.fixedHeaderElement = null;
6849
6849
  }
6850
6850
  if (!eventArgs.cancel) {
6851
+ _this.destroyPopupPositionObserver();
6851
6852
  if (_this.isPopupOpen && _this.allowFiltering && _this.isDeviceFullScreen && Browser.isDevice && Browser.isIos) {
6852
6853
  document.documentElement.scrollTo({
6853
6854
  top: _this.iOSscrollPosition.y,
@@ -6956,7 +6957,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6956
6957
  if (isNullOrUndefined(observerTarget)) {
6957
6958
  return;
6958
6959
  }
6959
- this.popupPositionObserver = new MutationObserver(function () {
6960
+ this.popupPositionObserver = new MutationObserver(function (mutations) {
6961
+ // Ignore the component's own changes (focus / icon-animation classes) to avoid needless refresh cycles.
6962
+ var external = mutations.some(function (m) {
6963
+ return isNullOrUndefined(_this.inputWrapper) || !_this.inputWrapper.container.contains(m.target);
6964
+ });
6965
+ if (!external) {
6966
+ return;
6967
+ }
6960
6968
  clearTimeout(_this.popupPositionRefreshTimer);
6961
6969
  _this.popupPositionRefreshTimer = setTimeout(function () {
6962
6970
  if (!isNullOrUndefined(_this.popupObj) &&
@@ -6971,6 +6979,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6971
6979
  attributes: true,
6972
6980
  attributeFilter: ['style', 'class']
6973
6981
  });
6982
+ // Content added or removed before the input (for example a delayed validation message) is a direct child change
6983
+ // of one of its ancestors, so watch only those child lists (not their subtrees) up to, but excluding, the body.
6984
+ var ancestor = observerTarget.parentElement;
6985
+ while (ancestor && ancestor !== document.body && ancestor !== document.documentElement) {
6986
+ this.popupPositionObserver.observe(ancestor, { childList: true });
6987
+ ancestor = ancestor.parentElement;
6988
+ }
6974
6989
  };
6975
6990
  DropDownList.prototype.destroyPopupPositionObserver = function () {
6976
6991
  if (this.popupPositionRefreshTimer) {
@@ -7893,7 +7908,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7893
7908
  */
7894
7909
  DropDownList.prototype.hidePopup = function (e) {
7895
7910
  /* eslint-enable valid-jsdoc, jsdoc/require-param */
7896
- this.destroyPopupPositionObserver();
7897
7911
  if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
7898
7912
  if (!isNullOrUndefined(this.inputElement)) {
7899
7913
  Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);