From 928969b7e4cf53161c54c2b13fc39afb2e0734f7 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 22 Oct 2022 11:35:43 -0700 Subject: [PATCH] Readjust on scroller height change --- src/components/ScrollerManager.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/ScrollerManager.vue b/src/components/ScrollerManager.vue index 3ce6ee4f..39230dc8 100644 --- a/src/components/ScrollerManager.vue +++ b/src/components/ScrollerManager.vue @@ -53,6 +53,8 @@ export default class ScrollerManager extends Mixins(GlobalMixin) { /** Recycler before slot component */ @Prop() recyclerBefore!: any; + /** Last known height at adjustment */ + private lastAdjustHeight = 0; /** Height of the entire photo view */ private recyclerHeight: number = 100; /** Computed ticks */ @@ -229,6 +231,12 @@ export default class ScrollerManager extends Mixins(GlobalMixin) { // of some tick has changed. let needRecomputeTop = false; + // Check if height changed + if (this.lastAdjustHeight !== this.height) { + needRecomputeTop = true; + this.lastAdjustHeight = this.height; + } + for (const row of this.rows) { // Check if tick is valid if (tickId >= this.ticks.length) break;