aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Koivisto <markus@vaadin.com>2014-04-25 16:58:53 +0300
committerSauli Tähkäpää <sauli@vaadin.com>2014-05-22 11:02:27 +0300
commit4058b7b063075fed15771eef30cc87b0f58f0cda (patch)
treef8e20c6c0c3aaedb380757295e121a2dff80d1a2
parentcbc369d8da808ea0f980adb09198d4bea3a9f540 (diff)
downloadvaadin-framework-4058b7b063075fed15771eef30cc87b0f58f0cda.tar.gz
vaadin-framework-4058b7b063075fed15771eef30cc87b0f58f0cda.zip
Change forceUpdate flag to always force recalculation of width. Fix tests. (#13444)
Change-Id: Ie666e2867908160b1544d3bf8251802ea771660f Conflicts: client/src/com/vaadin/client/ui/VFilterSelect.java uitest/src/com/vaadin/tests/components/ui/ComboboxStyleChangeWidthTest.java
-rw-r--r--client/src/com/vaadin/client/ui/VFilterSelect.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/VFilterSelect.java b/client/src/com/vaadin/client/ui/VFilterSelect.java
index 94adc1c4b5..cfa128fb15 100644
--- a/client/src/com/vaadin/client/ui/VFilterSelect.java
+++ b/client/src/com/vaadin/client/ui/VFilterSelect.java
@@ -1924,6 +1924,20 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
* For internal use only. May be removed or replaced in the future.
*/
public void updateRootWidth() {
+ updateRootWidth(false);
+ }
+
+ /**
+ * Calculates the width of the select if the select has undefined width.
+ * Should be called when the width changes or when the icon changes.
+ * <p>
+ * For internal use only. May be removed or replaced in the future.
+ *
+ * @param forceUpdate
+ * a flag that forces a recalculation even if one would not
+ * normally be done
+ */
+ public void updateRootWidth(boolean forceUpdate) {
ComponentConnector paintable = ConnectorMap.get(client).getConnector(
this);
if (paintable.isUndefinedWidth()) {
@@ -1936,7 +1950,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
* wide.
*/
int w = Util.getRequiredWidth(this);
- if ((!initDone || currentPage + 1 < 0)
+
+ if (forceUpdate || (!initDone || currentPage + 1 < 0)
&& suggestionPopupMinWidth > w) {
/*
* We want to compensate for the paddings just to preserve the