aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-05-15 18:35:25 +1000
committerTerry Truong <terry06890@gmail.com>2022-05-15 18:35:25 +1000
commit09db67f3b104ef6e61a49e6df8fe46c5233cbea7 (patch)
treef638c04d268435b4461d33c8c1d9ff69b4458048
parenta840a16c6bd5aef906bd5cbce8293fc863cb5a5d (diff)
For overflowing tiles, load some out-of-view child tilesload-some-outside-overflow
Intended to reduce cases of tiles becoming visible after their area is scrolled into view. Doesn't really help if user scrolls quickly, and rows have many tiles.
-rw-r--r--src/components/Tile.vue5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/Tile.vue b/src/components/Tile.vue
index da3c29c..38a3e12 100644
--- a/src/components/Tile.vue
+++ b/src/components/Tile.vue
@@ -58,6 +58,9 @@ export default defineComponent({
break;
}
}
+ const NUM_EXTRA = 10;
+ firstIdx = Math.max(0, firstIdx - NUM_EXTRA);
+ lastIdx = Math.min(children.length, lastIdx + NUM_EXTRA);
return children.slice(firstIdx, lastIdx);
},
// Basic abbreviations
@@ -375,7 +378,7 @@ export default defineComponent({
console.log('handling scroll')
this.scrollOffset = this.$el.scrollTop;
this.pendingScrollHdlr = 0;
- }, 50);
+ }, 300);
}
},
// Other