Skip to content

Commit 1608983

Browse files
committed
fix(settings): adjust scroll offset in settings
1 parent fb6a1e4 commit 1608983

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/views/settings/SettingsComponent.vue

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import SettingsCache from '~/components/views/settings/SettingsCache.vue';
88
import SettingsLinks from '~/components/views/settings/SettingsLinks.vue';
99
import SettingsLogs from '~/components/views/settings/SettingsLogs.vue';
1010
import SettingsTabs from '~/components/views/settings/SettingsTabs.vue';
11-
1211
import { useI18n } from '~/utils';
1312
1413
const i18n = useI18n('settings');
@@ -33,9 +32,11 @@ const target = ref();
3332
const scrollTo = (section: Section) => {
3433
target.value = section;
3534
focus.value = section;
36-
section.reference?.value?.[0]?.$el?.scrollIntoView({
35+
36+
const element: HTMLDivElement = section.reference?.value?.[0]?.$el;
37+
element?.scrollIntoView({
3738
behavior: 'smooth',
38-
block: 'center',
39+
block: 'start',
3940
});
4041
};
4142
@@ -116,6 +117,7 @@ onDeactivated(() => {
116117
@include mixin.hover-background($from: var(--bg-black-50), $to: var(--bg-color-80));
117118
118119
z-index: var(--index);
120+
scroll-margin-top: calc(#{layout.$header-navbar-height} + 1rem);
119121
120122
&:not(:last-child) {
121123
margin-bottom: 1rem;

0 commit comments

Comments
 (0)