From 4c6331f438b158717dc4dfc835545e16606764c0 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 10 May 2023 16:44:02 -0400 Subject: [PATCH] Fixes scroll jumping issue on interactive settings --- src/webviews/apps/settings/settings.scss | 2 +- src/webviews/apps/shared/appWithConfigBase.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webviews/apps/settings/settings.scss b/src/webviews/apps/settings/settings.scss index 4aaa50f..9203e33 100644 --- a/src/webviews/apps/settings/settings.scss +++ b/src/webviews/apps/settings/settings.scss @@ -249,7 +249,7 @@ header { .image__preview { display: flex; - width: auto; + width: 100%; margin-top: 1em; } } diff --git a/src/webviews/apps/shared/appWithConfigBase.ts b/src/webviews/apps/shared/appWithConfigBase.ts index 0edfb28..4f21010 100644 --- a/src/webviews/apps/shared/appWithConfigBase.ts +++ b/src/webviews/apps/shared/appWithConfigBase.ts @@ -356,7 +356,7 @@ export abstract class AppWithConfig extends Ap const newTop = el.getBoundingClientRect().top - document.body.getBoundingClientRect().top - (offset ?? 0); - if (top === newTop) return; + if (Math.abs(top - newTop) < 2) return; this.scrollTo(el, behavior, offset); }, 50);