diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2018-02-27 17:05:22 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-02-27 17:05:22 +0200 |
commit | a0a9eee14fed0d5c6b7a8ae5b5f9185d7cef1279 (patch) | |
tree | b33c2e9a0847c32d54db5a30b02f1186a8eb154c /client | |
parent | 6d84351fee4bdb6e877d9100c8645e6c6044864e (diff) | |
download | vaadin-framework-a0a9eee14fed0d5c6b7a8ae5b5f9185d7cef1279.tar.gz vaadin-framework-a0a9eee14fed0d5c6b7a8ae5b5f9185d7cef1279.zip |
Fix client and server filter state mismatch in Combobox (#10630)
Fixes #10624
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 334b630724..544f041770 100644 --- a/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -196,7 +196,7 @@ public class ComboBoxConnector extends AbstractListingConnector * the current filter string */ protected void setFilter(String filter) { - if (!Objects.equals(filter, getWidget().lastFilter)) { + if (!Objects.equals(filter, getState().currentFilterText)) { getDataReceivedHandler().clearPendingNavigation(); rpc.setFilter(filter); @@ -243,10 +243,9 @@ public class ComboBoxConnector extends AbstractListingConnector page = 0; } VComboBox widget = getWidget(); - int adjustment = widget.nullSelectionAllowed && filter.isEmpty() - ? 1 : 0; - int startIndex = Math.max(0, - page * widget.pageLength - adjustment); + int adjustment = widget.nullSelectionAllowed && filter.isEmpty() ? 1 + : 0; + int startIndex = Math.max(0, page * widget.pageLength - adjustment); int pageLength = widget.pageLength > 0 ? widget.pageLength : getDataSource().size(); getDataSource().ensureAvailability(startIndex, pageLength); |