diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2020-05-20 10:39:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 10:39:17 +0300 |
commit | 222705a48b80a23d6cd3f2884367a249a0130638 (patch) | |
tree | 4d19f3e00d906f153206c244944bda072dd6284e /compatibility-server | |
parent | 452357791fe20aae1e9b650c646bc70e8446d86c (diff) | |
download | vaadin-framework-222705a48b80a23d6cd3f2884367a249a0130638.tar.gz vaadin-framework-222705a48b80a23d6cd3f2884367a249a0130638.zip |
Fix compatibility ComboBox filtering when page length is zero. (#12016)
Issue #11246, slightly modified cherry-pick from #11247
Diffstat (limited to 'compatibility-server')
-rw-r--r-- | compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java index aaccdb8b25..f502aedd8e 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java @@ -620,7 +620,9 @@ public class ComboBox extends AbstractSelect // page length usable for non-null items int effectivePageLength = pageLength - (needNullSelectOption && (currentPage == 0) ? 1 : 0); - return Math.min(size - 1, first + effectivePageLength - 1); + // zero pageLength implies infinite page size + return pageLength == 0 ? size - 1 + : Math.min(size - 1, first + effectivePageLength - 1); } /** |