Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComboBox computed width breaks on stylename change #4977

Closed
vaadin-bot opened this issue Mar 11, 2014 · 4 comments
Closed

ComboBox computed width breaks on stylename change #4977

vaadin-bot opened this issue Mar 11, 2014 · 4 comments
Labels

Comments

@vaadin-bot
Copy link
Collaborator

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

#!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:

#!xml
<div role="combobox" class="v-filterselect v-widget" style="width: 348px;">
	<input type="text" class="v-filterselect-input" tabindex="0" style="width: 326px;">
	<div class="v-filterselect-button" aria-hidden="true" role="button"></div>
</div>

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):

#!xml
<div role="combobox" class="v-filterselect v-widget foofoo v-filterselect-foofoo" style>
	<input type="text" class="v-filterselect-input" tabindex="0" style="width: 326px;">
	<div class="v-filterselect-button" aria-hidden="true" role="button"></div>
</div>

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

@vaadin-bot
Copy link
Collaborator Author

Originally by @jdahlstrom


https://dev.vaadin.com/review/3210

@vaadin-bot
Copy link
Collaborator Author

Originally by Markus Koivisto


https://dev.vaadin.com/review/#/c/3562/

@vaadin-bot
Copy link
Collaborator Author

Originally by @Saulis


Regression detected with changing styles on empty comboboxes with undefined width. See StylingPopupOpener test.

@vaadin-bot
Copy link
Collaborator Author

Originally by @Saulis


Can't be picked for 7.2.4 before #14133 is checked.

@vaadin-bot vaadin-bot added the bug label Dec 10, 2016
@vaadin-bot vaadin-bot added this to the Vaadin 7.3.0.rc1 milestone Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant