From d0f67e2f790ee9fd97838a60629f2c4194df9716 Mon Sep 17 00:00:00 2001 From: Benjamin Kane Date: Tue, 13 Aug 2024 10:26:08 -0400 Subject: [PATCH] allow layout changes while scrolling, disabled when zooming (#4665) --- app/packages/spotlight/src/createScrollReader.ts | 2 +- app/packages/spotlight/src/index.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/packages/spotlight/src/createScrollReader.ts b/app/packages/spotlight/src/createScrollReader.ts index 71cc67909d..dee64107f2 100644 --- a/app/packages/spotlight/src/createScrollReader.ts +++ b/app/packages/spotlight/src/createScrollReader.ts @@ -69,6 +69,6 @@ export default function createScrollReader( destroy: () => { destroyed = true; }, - scrolling: () => scrolling, + zooming: () => zooming }; } diff --git a/app/packages/spotlight/src/index.ts b/app/packages/spotlight/src/index.ts index b142f1e07c..689d69e8b1 100644 --- a/app/packages/spotlight/src/index.ts +++ b/app/packages/spotlight/src/index.ts @@ -18,7 +18,7 @@ import { SCROLLBAR_WIDTH, TWO, ZERO, - ZOOMING_COEFFICIENT, + ZOOMING_COEFFICIENT } from "./constants"; import createScrollReader from "./createScrollReader"; import { Load, RowChange } from "./events"; @@ -190,7 +190,7 @@ export default class Spotlight extends EventTarget { requestAnimationFrame(() => { if ( this.#element.scrollTop > this.#containerHeight || - this.#scrollReader.scrolling() + this.#scrollReader.zooming() ) { requestAnimationFrame(run); return; @@ -258,7 +258,7 @@ export default class Spotlight extends EventTarget { requestAnimationFrame(() => { if ( this.#element.scrollTop < ZERO || - this.#scrollReader.scrolling() + this.#scrollReader.zooming() ) { requestAnimationFrame(run); return;