fix sizing of DDL

Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/70a5a04b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/70a5a04b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/70a5a04b

Branch: refs/heads/develop
Commit: 70a5a04b4188cebb84d0a407def69720ced6435e
Parents: 201a01f
Author: Alex Harui <[email protected]>
Authored: Wed Oct 29 10:25:36 2014 -0700
Committer: Alex Harui <[email protected]>
Committed: Wed Oct 29 11:15:44 2014 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/html/beads/DropDownListView.as   | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/70a5a04b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DropDownListView.as
----------------------------------------------------------------------
diff --git 
a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DropDownListView.as
 
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DropDownListView.as
index cc885f6..d2a4945 100644
--- 
a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DropDownListView.as
+++ 
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/DropDownListView.as
@@ -88,10 +88,11 @@ package org.apache.flex.html.beads
                        downTextField.type = TextFieldType.DYNAMIC;
                        overTextField.selectable = false;
                        overTextField.type = TextFieldType.DYNAMIC;
+            // auto-size collapses if no text
                        //upTextField.autoSize = "left";
                        //downTextField.autoSize = "left";
                        //overTextField.autoSize = "left";
-            
+
             upArrows = new Shape();
             overArrows = new Shape();
             downArrows = new Shape();
@@ -153,6 +154,14 @@ package org.apache.flex.html.beads
                        SimpleButton(value).hitTestState = shape;
                        if (selectionModel.selectedIndex !== -1)
                                text = selectionModel.selectedItem.toString();
+            else
+                text = "^W_";
+            upTextField.height = upTextField.textHeight + 4;
+            downTextField.height = downTextField.textHeight + 4;
+            overTextField.height = overTextField.textHeight + 4;
+            if (selectionModel.selectedIndex == -1)
+                text = "";
+            
             IEventDispatcher(value).addEventListener("heightChanged", 
changeHandler);
             IEventDispatcher(value).addEventListener("widthChanged", 
changeHandler);
                        changeHandler(null);

Reply via email to