Hi all,
I'd like to report a small but reliably reproducible UI bug in the Vacation 
auto-reply settings. I'm on SOGo 5.12.9 (current nightly), and it happens 
identically in Firefox, Edge and Chrome, so it is not browser-specific.
Steps to reproduce:
1. Preferences > Mail > Vacation.
2. Tick "Enable vacation auto reply". The panel opens and the "Auto reply 
message" textarea renders at its normal, multi-line height.
3. Enter a multi-line message and save. All good, the message is stored and 
shown correctly.
4. Untick "Enable vacation auto reply" and save again. Works.
5. Tick "Enable vacation auto reply" again to turn it back on.
Expected: the textarea reappears at full height with the saved multi-line 
message.
Actual: the textarea is collapsed to a single visible line. The text is still 
present (scrolling works), but only one line is shown — until something forces 
a recalculation. Opening the dev tools (F12), which fires a window resize, 
instantly restores the correct height.
Root cause (as far as I can tell):
The vacation panel is wrapped in ng-show, so on disable the DOM is only hidden 
(display:none), not destroyed. While hidden, the Angular Material textarea 
auto-grow logic measures scrollHeight, which is 0 for a display:none element, 
and collapses the textarea to one line. When the panel is shown again via 
ng-show, nothing triggers a re-measure (no input event, no ngModel $render, no 
resize), so it stays collapsed. The F12/resize is what makes Material 
re-measure.
Suggested fix:
Changing the panel from ng-show to ng-if resolves it. With ng-if the subtree is 
recreated on re-enable, the textarea is created while visible, and Material's 
auto-grow runs on the fresh ngModel $render, yielding the correct height. The 
bound message is preserved since it lives in the controller model, not the DOM.
The element is in UI/Templates/PreferencesUI/UIxPreferences.wox, the vacation 
form panel:
 <div class="md-inline-form" layout="column" flex-offset="5"
      ng-show="app.preferences.defaults.Vacation.enabled == 1">
-> change ng-show to ng-if.
I've applied this locally and it fixes the issue with no side effects: saving, 
the vacation dates, and the address chips all still behave correctly.
Best regards,
Guido

Reply via email to