From f417aa4027ad86705d07b000600a90e4a6bd2334 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 22 Oct 2022 15:17:53 -0700 Subject: [PATCH] Fix deletion glitches on mobile (#89) --- src/components/Timeline.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index e53e5feb7..5e4590fd4 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -773,9 +773,8 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) { * * @param dayId id of day * @param data photos - * @param isAnimating prevents glitches due to height changes */ - processDay(dayId: number, data: IPhoto[], isAnimating=false) { + processDay(dayId: number, data: IPhoto[]) { if (!data) return; const head = this.heads[dayId]; @@ -864,11 +863,11 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) { } // Set row height - const jH = Math.round(jbox.rowHeight || jbox.height); + const jH = utils.roundHalf(jbox.rowHeight || jbox.height); const delta = jH - row.size; // If the difference is too small, it's not worth risking an adjustment // especially on square layouts on mobile. Also don't do this if animating. - if (!isAnimating && Math.abs(delta) > 5) { + if (Math.abs(delta) > 0) { if (rowY < scrollTop) { scrollTop += delta; } @@ -1040,7 +1039,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) { // Reflow all touched days for (const day of updatedDays) { const newDetail = day.detail.filter(p => !delPhotosSet.has(p)); - this.processDay(day.dayid, newDetail, true); + this.processDay(day.dayid, newDetail); } } }