diff --git a/client/components/main/popup.css b/client/components/main/popup.css index 5c411c8b2..9e102d0aa 100644 --- a/client/components/main/popup.css +++ b/client/components/main/popup.css @@ -158,7 +158,11 @@ margin-left: 0; } .pop-over .content-container .content.no-height { - height: 2.5vh; + height: 0; + overflow: hidden; + padding: 0; + margin: 0; + visibility: hidden; } .pop-over .quiet { /* padding: 6px 6px 4px;*/ diff --git a/client/lib/popup.js b/client/lib/popup.js index ab8ea8230..36981aa4d 100644 --- a/client/lib/popup.js +++ b/client/lib/popup.js @@ -46,6 +46,8 @@ window.Popup = new (class { return; } else { $(previousOpenerElement).removeClass('is-active'); + // Clean up previous popup content to prevent mixing + self._cleanupPreviousPopupContent(); } } @@ -58,7 +60,12 @@ window.Popup = new (class { if (clickFromPopup(evt) && self._getTopStack()) { openerElement = self._getTopStack().openerElement; } else { - self._stack = []; + // For Member Settings sub-popups, always start fresh to avoid content mixing + if (popupName.includes('changeLanguage') || popupName.includes('changeAvatar') || + popupName.includes('editProfile') || popupName.includes('changePassword') || + popupName.includes('invitePeople') || popupName.includes('support')) { + self._stack = []; + } openerElement = evt.currentTarget; } $(openerElement).addClass('is-active'); @@ -169,6 +176,8 @@ window.Popup = new (class { $(openerElement).removeClass('is-active'); this._stack = []; + // Clean up popup content when closing + this._cleanupPreviousPopupContent(); } } @@ -182,6 +191,13 @@ window.Popup = new (class { return this._stack[this._stack.length - 1]; } + _cleanupPreviousPopupContent() { + // Force a re-render to ensure proper cleanup + if (this._dep) { + this._dep.changed(); + } + } + // We automatically calculate the popup offset from the reference element // position and dimensions. We also reactively use the window dimensions to // ensure that the popup is always visible on the screen.