Readjust on scroller height change

old-stable24
Varun Patil 2022-10-22 11:35:43 -07:00
parent b610b6a454
commit 6435e84444
1 changed files with 8 additions and 0 deletions

View File

@ -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;