You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The computed inline width of an undefined-width ComboBox (with a sufficiently long option string) breaks when the component's stylename is changed after initial rendering.
The following code
#!java
cbFoo = new ComboBox();
cbFoo.setImmediate(true);
cbFoo.setSizeUndefined();
cbFoo.addItem("A really long string that causes an inline width to be set");
Button btn = new Button("Click to break CB", new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
cbFoo.addStyleName("foofoo");
}
});
produces, initially, the following html for the ComboBox:
Note the inline style width: 348px; on the ComboBox's root div.
Upon clicking the button that applies the stylename foofoo to the ComboBox, the inline width disapppears from the root div (but remains on the textfield inside):
In Reindeer and Chameleon this doesn't really cause any noticeable effects, since the width of the root div (sans inline width) will be determined by the textfield inside. It can, however, cause pretty confusing bugs in custom themes in which the root width is not expected to be determined by the textfield.
Originally by rsmeds
The computed inline width of an undefined-width ComboBox (with a sufficiently long option string) breaks when the component's stylename is changed after initial rendering.
The following code
produces, initially, the following html for the ComboBox:
Note the inline style
width: 348px;
on the ComboBox's root div.Upon clicking the button that applies the stylename
foofoo
to the ComboBox, the inline width disapppears from the root div (but remains on the textfield inside):In Reindeer and Chameleon this doesn't really cause any noticeable effects, since the width of the root div (sans inline width) will be determined by the textfield inside. It can, however, cause pretty confusing bugs in custom themes in which the root width is not expected to be determined by the textfield.
Imported from https://dev.vaadin.com/ issue #13444
The text was updated successfully, but these errors were encountered: