Fix incorrect scroll on date edit

old-stable24
Varun Patil 2022-10-16 19:58:18 -07:00
parent d3c771fb31
commit dfa37cddcd
1 changed files with 5 additions and 2 deletions

View File

@ -53,7 +53,7 @@ export default class ScrollerManager extends Mixins(GlobalMixin) {
@Prop() recyclerBefore!: any; @Prop() recyclerBefore!: any;
/** Height of the entire photo view */ /** Height of the entire photo view */
private recyclerHeight!: number; private recyclerHeight: number = 100;
/** Computed ticks */ /** Computed ticks */
private ticks: ITick[] = []; private ticks: ITick[] = [];
/** Computed cursor top */ /** Computed cursor top */
@ -96,8 +96,11 @@ export default class ScrollerManager extends Mixins(GlobalMixin) {
// Ignore if not initialized // Ignore if not initialized
if (!this.ticks.length) return; if (!this.ticks.length) return;
// Get the scroll position
const scroll = this.recycler?.$el?.scrollTop || 0;
// Move hover cursor to px position // Move hover cursor to px position
this.cursorY = utils.roundHalf(event ? event.target.scrollTop * this.height / this.recyclerHeight : 0); this.cursorY = utils.roundHalf(scroll * this.height / this.recyclerHeight);
this.moveHoverCursor(this.cursorY); this.moveHoverCursor(this.cursorY);
// Show the scroller for some time // Show the scroller for some time