From 85666f0f7a160e00652a3e8d57f73fa17f369d47 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 11 Dec 2008 12:37:48 +0000 Subject: Fix for #2315 - FF3 ComboBox rendering issue svn changeset:6170/svn branch:trunk --- .../toolkit/terminal/gwt/client/ui/IFilterSelect.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java index 3e8c73ad28..000ea4d22f 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java @@ -877,11 +877,20 @@ public class IFilterSelect extends Composite implements Paintable, Field, * div so the popupopener won't wrap to the next line and also so * the size of the combobox won't change over time. */ - int w = Util.getRequiredWidth(tb) - + Util.getRequiredWidth(popupOpener); + int tbWidth = Util.getRequiredWidth(tb); + int openerWidth = Util.getRequiredWidth(popupOpener); + + int w = tbWidth + openerWidth; if (suggestionPopupMinWidth > w) { setTextboxWidth(suggestionPopupMinWidth); w = suggestionPopupMinWidth; + } else { + /* + * Firefox3 has its own way of doing rendering so we need to + * specify the width for the TextField to make sure it actually + * is rendered as wide as FF3 says it is + */ + tb.setWidth((tbWidth - getTextboxPadding()) + "px"); } super.setWidth(w + "px"); @@ -911,7 +920,7 @@ public class IFilterSelect extends Composite implements Paintable, Field, private void setTextboxWidth(int componentWidth) { int padding = getTextboxPadding(); - int popupOpenerWidth = popupOpener.getOffsetWidth(); + int popupOpenerWidth = Util.getRequiredWidth(popupOpener); int textboxWidth = componentWidth - padding - popupOpenerWidth; if (textboxWidth < 0) { textboxWidth = 0; -- cgit v1.2.3