Bug 216434 - autocomplete dropdown covers textbox when textbox is near bottom of screen, r=neil, a=mconnor
authormartijn.martijn@gmail.com
Sun, 30 Sep 2007 12:00:10 -0700
changeset 22641 55c7f52e0e4ff6cc61b7c989f26fcb50454df898
parent 22640 2a36bd0acce5b7b4345a3cd560c1c886f2e9c9bc
child 22642 c377e77c7836a00b7fe6a6ed6465cdb89c2a93df
push id13793
push userfrgrahl@gmx.net
push dateMon, 27 Nov 2017 16:30:48 +0000
treeherdercomm-central@85eb5dd6d56a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, mconnor
bugs216434
Bug 216434 - autocomplete dropdown covers textbox when textbox is near bottom of screen, r=neil, a=mconnor
suite/common/autocomplete/resources/content/autocomplete.xml
--- a/suite/common/autocomplete/resources/content/autocomplete.xml
+++ b/suite/common/autocomplete/resources/content/autocomplete.xml
@@ -1400,17 +1400,17 @@
   </binding> 
 
   <binding id="autocomplete-result-popup" extends="chrome://global/content/bindings/popup.xml#popup">
     <resources>
       <stylesheet src="chrome://global/content/autocomplete.css"/>
       <stylesheet src="chrome://global/skin/autocomplete.css"/>
     </resources>
 
-    <content>
+    <content minwidth="100">
       <xul:tree anonid="tree" class="autocomplete-tree plain" flex="1">
         <xul:treecols anonid="treecols">
           <xul:treecol class="autocomplete-treecol" id="treecolAutoCompleteValue" flex="2"/>
           <xul:treecol class="autocomplete-treecol" id="treecolAutoCompleteComment" flex="1" hidden="true"/>
         </xul:treecols>
         <xul:treechildren anonid="treebody" class="autocomplete-treebody"/>
       </xul:tree>
     </content>
@@ -1555,31 +1555,32 @@
           return val;
         </setter>
       </property>
 
       <property name="popupOpen" onget="return !!this.input;" readonly="true"/>
 
       <method name="openAutocompletePopup">
         <parameter name="aInput"/>
-        <parameter name="aX"/>
-        <parameter name="aY"/>
-        <parameter name="aWidth"/>
-        <body>
+        <parameter name="aElement"/>
+        <body><![CDATA[
           if (!this.input) {
             this.tree.view = aInput.controller;
             this.view = this.tree.view;
             this.showCommentColumn = aInput.showCommentColumn;
             this.input = aInput;
-            this.width = aWidth;
             this.invalidate();
-            this.openPopupAtScreen(aX, aY, false);
+
+            var rect = aElement.getBoundingClientRect();
+            this.setAttribute("width", rect.right - rect.left);            
+            this.openPopup(aElement, "after_start", 0, 0, false, false);
+
             this.popupBoxObject.setConsumeRollupEvent(aInput.consumeRollupEvent);
           }
-        </body>
+        ]]></body>
       </method>
 
       <method name="closePopup">
         <body>
           this.hidePopup();
         </body>
       </method>