Bug 1549146 - Resize the subdialog after showing/hiding the Custom textbox to make sure scrollbars appear if necessary. r=sfoster
☠☠ backed out by 70b7703b8c13 ☠ ☠
authorJared Wein <jwein@mozilla.com>
Mon, 06 May 2019 15:42:33 +0000
changeset 472726 036a4b9e84262578b682d6e36ac60416db334d07
parent 472725 b821fc0de45c129f8daebbcff0ee885cd97bd45f
child 472727 c737fc642ddcaa5846383f906ec3f24145d4a7a5
push id84801
push userjwein@mozilla.com
push dateMon, 06 May 2019 16:10:04 +0000
treeherderautoland@036a4b9e8426 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfoster
bugs1549146
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1549146 - Resize the subdialog after showing/hiding the Custom textbox to make sure scrollbars appear if necessary. r=sfoster Differential Revision: https://phabricator.services.mozilla.com/D30068
browser/components/preferences/connection.js
--- a/browser/components/preferences/connection.js
+++ b/browser/components/preferences/connection.js
@@ -401,16 +401,25 @@ var gConnectionsDialog = {
     if (!menu.disabled && isCustom) {
       customContainer.hidden = false;
       customInput.disabled = false;
       customContainer.scrollIntoView();
     } else {
       customContainer.hidden = true;
       customInput.disabled = true;
     }
+
+    // The height has likely changed, find our SubDialog and tell it to resize.
+    requestAnimationFrame(() => {
+      let dialogs = window.opener.gSubDialog._dialogs;
+      let index = dialogs.findIndex(d => d._frame.contentDocument == document);
+      if (index != -1) {
+        dialogs[index].resizeDialog();
+      }
+    });
   },
 
   getDnsOverHttpsControls() {
     return [
       document.getElementById("networkDnsOverHttpsResolverChoices"),
       document.getElementById("networkCustomDnsOverHttpsInput"),
       document.getElementById("networkDnsOverHttpsResolverChoicesLabel"),
       document.getElementById("networkCustomDnsOverHttpsInputLabel"),