From b3d683e974f7c3b2269753aec615872b2cddc180 Mon Sep 17 00:00:00 2001 From: Markus Koivisto Date: Wed, 21 May 2014 15:33:31 +0300 Subject: [PATCH] Treat initial rendering and style changes separately. (#13444) This fixes a regression caused by a previous patch, which led to empty comboboxes being initialised with a zero width. Change-Id: I7e5ca0c563625c453e0e3006d91ed52ad227d6f0 Conflicts: client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java --- .../vaadin/client/ui/combobox/ComboBoxConnector.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 6c8ccf32a8..f6f943424b 100644 --- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -207,8 +207,17 @@ public class ComboBoxConnector extends AbstractFieldConnector implements getWidget().popupOpenerClicked = false; + /* + * if styles have changed or this is our first time we need to + * recalculate the root width. + */ if (!getWidget().initDone) { - getWidget().updateRootWidth(); + // no need to force update since we have no existing width + getWidget().updateRootWidth(false); + } else if (stylesChanged) { + // we have previously calculated a width, we must force an update + // due to changed styles + getWidget().updateRootWidth(true); } // Focus dependent style names are lost during the update, so we add -- 2.39.5