Curl Global Community

Full Version: Dropdownlist: height changes when selected?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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 " ".
(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.
Will give it a try.


Thank you!