From fcb2c5ecc213381cbe1cde652cd26b1c36301c68 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Fri, 13 Nov 2026 15:57:22 +0100 Subject: [PATCH] fix(mail): all folders are correctly listed when displaying/hiding external accounts --- .gitignore | 2 +- .../js/Mailer/sgAccountSection.directive.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2927d3426..3808da555 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,4 @@ SoObjects/SOGo/SOGoSAML2Exceptions.* node_modules CLAUDE.md -.claude/ \ No newline at end of file +.claude/ diff --git a/UI/WebServerResources/js/Mailer/sgAccountSection.directive.js b/UI/WebServerResources/js/Mailer/sgAccountSection.directive.js index 102e4bf19..39114b2b3 100644 --- a/UI/WebServerResources/js/Mailer/sgAccountSection.directive.js +++ b/UI/WebServerResources/js/Mailer/sgAccountSection.directive.js @@ -26,6 +26,24 @@ this.quotaElement = _.find($element.find('div'), function(div) { return div.classList.contains('sg-quota'); }); + + // The mailboxes list (md-virtual-repeat) only renders the rows that fit in its last + // measured height, and only re-measures on window resize. Expanding/collapsing an + // account changes the height of the other accounts' lists, so re-measure on any resize. + var container = $element[0].querySelector('md-virtual-repeat-container'); + if (container && window.ResizeObserver) { + this.resizeObserver = new ResizeObserver(function () { + var containerCtrl = angular.element(container).controller('mdVirtualRepeatContainer'); + if (containerCtrl && containerCtrl.repeater) + containerCtrl.updateSize(); + }); + this.resizeObserver.observe(container); + } + }; + + this.$onDestroy = function () { + if (this.resizeObserver) + this.resizeObserver.disconnect(); };