diff options
-rw-r--r-- | client/src/com/vaadin/client/ui/VFilterSelect.java | 17 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java | 28 |
2 files changed, 2 insertions, 43 deletions
diff --git a/client/src/com/vaadin/client/ui/VFilterSelect.java b/client/src/com/vaadin/client/ui/VFilterSelect.java index 5fed1b4e42..5e3b9123eb 100644 --- a/client/src/com/vaadin/client/ui/VFilterSelect.java +++ b/client/src/com/vaadin/client/ui/VFilterSelect.java @@ -1930,20 +1930,6 @@ 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()) { @@ -1956,8 +1942,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * wide. */ int w = Util.getRequiredWidth(this); - - if (forceUpdate || (!initDone || currentPage + 1 < 0) + if ((!initDone || currentPage + 1 < 0) && suggestionPopupMinWidth > w) { /* * We want to compensate for the paddings just to preserve the diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java index c825d05e5e..21fa73864e 100644 --- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -24,7 +24,6 @@ import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.Paintable; import com.vaadin.client.UIDL; -import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.client.ui.SimpleManagedLayout; import com.vaadin.client.ui.VFilterSelect; @@ -44,10 +43,6 @@ public class ComboBoxConnector extends AbstractFieldConnector implements // update textbox text by a changed item caption. private boolean oldSuggestionTextMatchTheOldSelection; - // Need to recompute the width of the combobox when styles change, see - // #13444 - private boolean stylesChanged; - /* * (non-Javadoc) * @@ -200,17 +195,8 @@ 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) { - // 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); + getWidget().updateRootWidth(); } // Focus dependent style names are lost during the update, so we add @@ -219,9 +205,6 @@ public class ComboBoxConnector extends AbstractFieldConnector implements getWidget().addStyleDependentName("focus"); } - // width has been recalculated above, clear style change flag - stylesChanged = false; - getWidget().initDone = true; } @@ -344,13 +327,4 @@ public class ComboBoxConnector extends AbstractFieldConnector implements getWidget().enabled = widgetEnabled; getWidget().tb.setEnabled(widgetEnabled); } - - @Override - public void onStateChanged(StateChangeEvent event) { - super.onStateChanged(event); - if (event.hasPropertyChanged("styles")) { - stylesChanged = true; - } - } - } |