]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix the end limit of the allowed scrollTo rows. (#11771)
authorAnna Koskinen <Ansku@users.noreply.github.com>
Mon, 28 Oct 2019 11:06:43 +0000 (13:06 +0200)
committerGitHub <noreply@github.com>
Mon, 28 Oct 2019 11:06:43 +0000 (13:06 +0200)
- Row index counts up from zero, data provider size counts up from one,
as one would expect. If the two match we are already past the available
range.

server/src/main/java/com/vaadin/ui/Grid.java

index 8d19d89a7e0ec5b2a404ab5a139ebc76f0fed773..1ac71ff9844ae03b57eaf300fd1162cd82777d72 100644 (file)
@@ -4390,7 +4390,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents,
         Objects.requireNonNull(destination,
                 "ScrollDestination can not be null");
 
-        if (row > getDataCommunicator().getDataProviderSize()) {
+        if (row >= getDataCommunicator().getDataProviderSize()) {
             throw new IllegalArgumentException("Row outside dataProvider size");
         }