Curl Global Community
Dropdownlist: height changes when selected? - Printable Version

+- Curl Global Community (https://communities.curl.com)
+-- Forum: Discussions (https://communities.curl.com/forumdisplay.php?fid=1)
+--- Forum: General Curl questions (https://communities.curl.com/forumdisplay.php?fid=2)
+--- Thread: Dropdownlist: height changes when selected? (/showthread.php?tid=161)



Dropdownlist: height changes when selected? - swan - 07-27-2011


When nothing is selected (null), the height shrinks. When something is selected, the height expands.


Is there any way to prevent this from happening, other than to set its default value as " ".


RE: Dropdownlist: height changes when selected? - c-s - 07-27-2011

(07-27-2011, 01:05 PM)swan Wrote: When nothing is selected (null), the height shrinks. When something is selected, the height expands.


Is there any way to prevent this from happening, other than to set its default value as " ".

This often happens when your list items are of variable size, or the first item is "", or the control otherwise has labels that don't match the height of the font used by the DropdownList. You might try setting font[-size] on the control itself if you're setting it on each label currently. You can also set the height on the DropdownList itself, if you have usable size.

Otherwise, the easiest workaround is to, as you suggest, do something like:

Code:
{value
    def li = {ListValueItem "", label = {text \ }}
    def ddl =
        {DropdownList
            li,
            "asd",
            "asdasda",
            value = ""
        }
    ddl
}

That workaround is also the better way to display a "" (empty String) option.



RE: Dropdownlist: height changes when selected? - swan - 07-27-2011

Will give it a try.


Thank you!