summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Koivisto <markus@vaadin.com>2014-05-21 15:33:31 +0300
committerSauli Tähkäpää <sauli@vaadin.com>2014-05-22 07:52:41 +0000
commit3eb261feffe66e364ebb4472ab5d3d27869e3835 (patch)
treeaeddf0cf75c6c6e9693066c55b36fd7cff637e3b
parent34cadb00b0522af81fca851e96f670e1696c03a6 (diff)
downloadvaadin-framework-3eb261feffe66e364ebb4472ab5d3d27869e3835.tar.gz
vaadin-framework-3eb261feffe66e364ebb4472ab5d3d27869e3835.zip
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
-rw-r--r--client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
index 97e8f8363b..c3cdb43703 100644
--- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
+++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
@@ -50,7 +50,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements
/*
* (non-Javadoc)
- *
+ *
* @see com.vaadin.client.Paintable#updateFromUIDL(com.vaadin.client.UIDL,
* com.vaadin.client.ApplicationConnection)
*/
@@ -200,11 +200,17 @@ public class ComboBoxConnector extends AbstractFieldConnector implements
getWidget().popupOpenerClicked = false;
- // styles have changed or this is our first time - either way we
- // need to recalculate the root width.
- if (!getWidget().initDone || stylesChanged) {
- boolean forceUpdate = true;
- getWidget().updateRootWidth(forceUpdate);
+ /*
+ * if styles have changed or this is our first time we need to
+ * recalculate the root width.
+ */
+ if (!getWidget().initDone) {
+ // 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