summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorPekka Hyvönen <pekka@vaadin.com>2017-03-14 16:14:57 +0200
committerHenri Sara <henri.sara@gmail.com>2017-03-30 11:20:55 +0300
commit9762a7c2726f4aa0ad96379ea5d49c195ee764e8 (patch)
tree1d67112cfcf658e838b2fe712ffb80112d0b6c84 /client
parent0f1653d3539a903e923b4c528b8257bdc404cb89 (diff)
downloadvaadin-framework-9762a7c2726f4aa0ad96379ea5d49c195ee764e8.tar.gz
vaadin-framework-9762a7c2726f4aa0ad96379ea5d49c195ee764e8.zip
Fix removing rows over the cached range in Grid
Fixes #8840
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java b/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java
index cf7a121190..a5cdace776 100644
--- a/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java
+++ b/client/src/main/java/com/vaadin/client/data/AbstractRemoteDataSource.java
@@ -580,7 +580,15 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> {
Range remainsBefore = partitions[0];
Range transposedRemainsAfter = partitions[2]
.offsetBy(-removedRange.length());
- cached = remainsBefore.combineWith(transposedRemainsAfter);
+ // #8840 either can be empty if the removed range was over the
+ // cached range
+ if (remainsBefore.isEmpty()) {
+ cached = transposedRemainsAfter;
+ } else if (transposedRemainsAfter.isEmpty()) {
+ cached = remainsBefore;
+ } else {
+ cached = remainsBefore.combineWith(transposedRemainsAfter);
+ }
} else if (removedRange.getEnd() <= cached.getStart()) {
// Removal was before the cache. offset the cache.
cached = cached.offsetBy(-removedRange.length());