From 222705a48b80a23d6cd3f2884367a249a0130638 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Wed, 20 May 2020 10:39:17 +0300 Subject: Fix compatibility ComboBox filtering when page length is zero. (#12016) Issue #11246, slightly modified cherry-pick from #11247 --- compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compatibility-server/src') 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); } /** -- cgit v1.2.3