Readjust on scroller height change
parent
b610b6a454
commit
6435e84444
|
@ -53,6 +53,8 @@ export default class ScrollerManager extends Mixins(GlobalMixin) {
|
||||||
/** Recycler before slot component */
|
/** Recycler before slot component */
|
||||||
@Prop() recyclerBefore!: any;
|
@Prop() recyclerBefore!: any;
|
||||||
|
|
||||||
|
/** Last known height at adjustment */
|
||||||
|
private lastAdjustHeight = 0;
|
||||||
/** Height of the entire photo view */
|
/** Height of the entire photo view */
|
||||||
private recyclerHeight: number = 100;
|
private recyclerHeight: number = 100;
|
||||||
/** Computed ticks */
|
/** Computed ticks */
|
||||||
|
@ -229,6 +231,12 @@ export default class ScrollerManager extends Mixins(GlobalMixin) {
|
||||||
// of some tick has changed.
|
// of some tick has changed.
|
||||||
let needRecomputeTop = false;
|
let needRecomputeTop = false;
|
||||||
|
|
||||||
|
// Check if height changed
|
||||||
|
if (this.lastAdjustHeight !== this.height) {
|
||||||
|
needRecomputeTop = true;
|
||||||
|
this.lastAdjustHeight = this.height;
|
||||||
|
}
|
||||||
|
|
||||||
for (const row of this.rows) {
|
for (const row of this.rows) {
|
||||||
// Check if tick is valid
|
// Check if tick is valid
|
||||||
if (tickId >= this.ticks.length) break;
|
if (tickId >= this.ticks.length) break;
|
||||||
|
|
Loading…
Reference in New Issue