From f1989ba456a0ec529652ca46fa65d30940b6eb54 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Thu, 23 Feb 2012 09:20:31 +0200 Subject: [PATCH] Properly lock the width of the combo box text field (#8313) --- .../terminal/gwt/client/ui/VFilterSelect.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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%"); } } -- 2.39.5