From: Leif Åstrand Date: Thu, 23 Feb 2012 07:20:31 +0000 (+0200) Subject: Properly lock the width of the combo box text field (#8313) X-Git-Tag: 7.0.0.alpha2~434^2~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f1989ba456a0ec529652ca46fa65d30940b6eb54;p=vaadin-framework.git Properly lock the width of the combo box text field (#8313) --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index 83956ecf03..d4d9e99dea 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -1576,6 +1576,15 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, && suggestionPopupMinWidth > w) { setWidth(suggestionPopupMinWidth + "px"); } + + /* + * Lock the textbox width to its current value if it's not already + * locked + */ + if (!tb.getElement().getStyle().getWidth().endsWith("px")) { + tb.setWidth((tb.getOffsetWidth() - selectedItemIcon + .getOffsetWidth()) + "px"); + } } } @@ -1592,9 +1601,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, @Override public void setWidth(String width) { super.setWidth(width); - if (width.length() == 0) { - tb.setWidth(""); - } else { + if (width.length() != 0) { tb.setWidth("100%"); } }