The select
fields have both the same size attribute, but the options
having a class with a specific padding (all the same class). But an empty select field has now a different length if it has no option
elements.
+-------------+ +-------------+
| foo | +---+ | |
| bar | | > | | |
| baz | +---+ | |
| | | |
| | +---+ | |
| | | < | | |
| | +---+ | |
| | +-------------+
+-------------+
HTML
<style type="text/css">
select option {padding:1px;}
</style>
<select size="10" style="width:100px;">
<option>foo</option>
<option>bar</option>
<option>baz</option>
</select>
[...]
<select size="10" style="width:100px;">
<!-- empty yet -->
</select>
After connection (a new option appeared in the second select
field) the height swaps to the same length as the first
+-------------+ +-------------+
| foo | +---+ | baz |
| bar | | > | | |
| | +---+ | |
| | | |
| | +---+ | |
| | | < | | |
| | +---+ | |
+-------------+ +-------------+
Any idea to solve this without specifiying an absolute height for both select
fields?